Physics constants: Difference between revisions

From ENIGMA
Jump to navigation Jump to search
Line 36: Line 36:


===General===
===General===
*'''phy_joint_anchor_1_x''' (x, y) coordinate of the first anchor of the joint
{| cellpadding=5 cellspacing=0 border=1 align=left style="background-color:#FAD796;"
*'''phy_joint_anchor_1_y'''
| cellpadding=5 cellspacing=0 border=1 align=left style="background-color:black; color:white;" | '''Constant'''
*'''phy_joint_anchor_2_x''' (x, y) coordinate of the second anchor of the joint
| cellpadding=5 cellspacing=0 border=1 align=left style="background-color:black; color:white;" | Description
*'''phy_joint_anchor_2_y'''
|-
*'''phy_joint_reaction_force_x''' (x, y) reaction force applied to the second instance of a joint at the anchor coordinate
|'''phy_joint_anchor_1_x'''
*'''phy_joint_reaction_force_y'''
|(x, y) coordinate of the first anchor of the joint
*'''phy_joint_reaction_torque''' torque applied to the second instance of a joint at the anchor position
|-
|'''phy_joint_anchor_1_y'''
|
|-
|'''phy_joint_anchor_2_x'''
|(x, y) coordinate of the second anchor of the joint
|-
|'''phy_joint_anchor_2_y'''
|
|-
|'''phy_joint_reaction_force_x'''
|(x, y) reaction force applied to the second instance of a joint at the anchor coordinate
|-
|'''phy_joint_reaction_force_y'''
|
|-
|'''phy_joint_reaction_torque'''
|torque applied to the second instance of a joint at the anchor position
|}


===Motors===
===Motors===
{| cellpadding=5 cellspacing=0 border=1 align=left style="background-color:#FAD796;"
| cellpadding=5 cellspacing=0 border=1 align=left style="background-color:black; color:white;" | '''Constant'''
| cellpadding=5 cellspacing=0 border=1 align=left style="background-color:black; color:white;" | Description
|-
*'''phy_joint_max_motor_force''' maxmimum force for a motor, when it was created
*'''phy_joint_max_motor_force''' maxmimum force for a motor, when it was created
*'''phy_joint_max_motor_torque''' maximum torque for a motor, when it was created
*'''phy_joint_max_motor_torque''' maximum torque for a motor, when it was created
Line 50: Line 72:
*'''phy_joint_motor_speed''' current speed of a motor
*'''phy_joint_motor_speed''' current speed of a motor
*'''phy_joint_motor_torque''' current torque of a motor
*'''phy_joint_motor_torque''' current torque of a motor
|}


===Revolute===
===Revolute===
{| cellpadding=5 cellspacing=0 border=1 align=left style="background-color:#FAD796;"
| cellpadding=5 cellspacing=0 border=1 align=left style="background-color:black; color:white;" | '''Constant'''
| cellpadding=5 cellspacing=0 border=1 align=left style="background-color:black; color:white;" | Description
|-
*'''phy_joint_angle''' Angle created by the two anchor points of the joint. Calculated using the coordinates of the physics world, not using the room coordinates.
*'''phy_joint_angle''' Angle created by the two anchor points of the joint. Calculated using the coordinates of the physics world, not using the room coordinates.
|}


===Prismatic===
===Prismatic===
{| cellpadding=5 cellspacing=0 border=1 align=left style="background-color:#FAD796;"
| cellpadding=5 cellspacing=0 border=1 align=left style="background-color:black; color:white;" | '''Constant'''
| cellpadding=5 cellspacing=0 border=1 align=left style="background-color:black; color:white;" | Description
|-
*'''phy_joint_translation''' Gets the distance between the anchor coordinates or the local (x, y) coordinates.
*'''phy_joint_translation''' Gets the distance between the anchor coordinates or the local (x, y) coordinates.
*'''phy_joint_speed Current''' movement speed of a joint.
*'''phy_joint_speed Current''' movement speed of a joint.
|}


===Pulley===
===Pulley===
{| cellpadding=5 cellspacing=0 border=1 align=left style="background-color:#FAD796;"
| cellpadding=5 cellspacing=0 border=1 align=left style="background-color:black; color:white;" | '''Constant'''
| cellpadding=5 cellspacing=0 border=1 align=left style="background-color:black; color:white;" | Description
|-
*'''phy_joint_length_1''' Length of the joint from the first local coordinate (x, y) to the first anchor coordinate.
*'''phy_joint_length_1''' Length of the joint from the first local coordinate (x, y) to the first anchor coordinate.
*'''phy_joint_length_2''' Length of the joint from the second local coordinate (x, y) to the second anchor coordinate.
*'''phy_joint_length_2''' Length of the joint from the second local coordinate (x, y) to the second anchor coordinate.
|}


===Distance===
===Distance===
{| cellpadding=5 cellspacing=0 border=1 align=left style="background-color:#FAD796;"
| cellpadding=5 cellspacing=0 border=1 align=left style="background-color:black; color:white;" | '''Constant'''
| cellpadding=5 cellspacing=0 border=1 align=left style="background-color:black; color:white;" | Description
|-
*'''phy_joint_damping_ratio''' Damping ratio of a joint, is how "springy" it reacts and is non dimensional. It is usually between zero and one, at one being critical meaning all oscillations will vanish, but can be larger than one.
*'''phy_joint_damping_ratio''' Damping ratio of a joint, is how "springy" it reacts and is non dimensional. It is usually between zero and one, at one being critical meaning all oscillations will vanish, but can be larger than one.
*'''phy_joint_frequency''' Oscillation frequency of a joint in hertz, usually should be less than half of the time step, set with the function [[physics_world_update_speed]], and you can also change this variable.
*'''phy_joint_frequency''' Oscillation frequency of a joint in hertz, usually should be less than half of the time step, set with the function [[physics_world_update_speed]], and you can also change this variable.
|}

Revision as of 02:01, 19 April 2013

This article is an overview of physics related constants and variables.

Variables

These variables work like regular speed and direction and you can set them through code, they exist in all physics objects:

  • phy_active
  • phy_angular_velocity
  • phy_linear_velocity_x
  • phy_linear_velocity_y
  • phy_speed_x
  • phy_speed_y
  • phy_position_x
  • phy_position_y
  • phy_rotation
  • phy_fixed_rotation
  • phy_bullet

Read Only Variables

Some variables are changed internally by the engine but not able to be change directly by you, the end programmer:

  • phy_com_x
  • phy_com_y
  • phy_dynamic
  • phy_kinematic
  • phy_inertia
  • phy_mass
  • phy_sleeping

Collision Only Variables

Temporary variables in physics objects that can only be used in the collision event. Like the ones above and read-only:

  • phy_collision_points
  • phy_collision_x
  • phy_collision_y
  • phy_col_normal_x
  • phy_col_normal_y

Joint Constants

General

Constant Description
phy_joint_anchor_1_x (x, y) coordinate of the first anchor of the joint
phy_joint_anchor_1_y
phy_joint_anchor_2_x (x, y) coordinate of the second anchor of the joint
phy_joint_anchor_2_y
phy_joint_reaction_force_x (x, y) reaction force applied to the second instance of a joint at the anchor coordinate
phy_joint_reaction_force_y
phy_joint_reaction_torque torque applied to the second instance of a joint at the anchor position

Motors

  • phy_joint_max_motor_force maxmimum force for a motor, when it was created
  • phy_joint_max_motor_torque maximum torque for a motor, when it was created
  • phy_joint_motor_force current force of a motor
  • phy_joint_motor_speed current speed of a motor
  • phy_joint_motor_torque current torque of a motor
Constant Description

Revolute

  • phy_joint_angle Angle created by the two anchor points of the joint. Calculated using the coordinates of the physics world, not using the room coordinates.
Constant Description

Prismatic

  • phy_joint_translation Gets the distance between the anchor coordinates or the local (x, y) coordinates.
  • phy_joint_speed Current movement speed of a joint.
Constant Description

Pulley

  • phy_joint_length_1 Length of the joint from the first local coordinate (x, y) to the first anchor coordinate.
  • phy_joint_length_2 Length of the joint from the second local coordinate (x, y) to the second anchor coordinate.
Constant Description

Distance

  • phy_joint_damping_ratio Damping ratio of a joint, is how "springy" it reacts and is non dimensional. It is usually between zero and one, at one being critical meaning all oscillations will vanish, but can be larger than one.
  • phy_joint_frequency Oscillation frequency of a joint in hertz, usually should be less than half of the time step, set with the function physics_world_update_speed, and you can also change this variable.
Constant Description