Physics constants: Difference between revisions

From ENIGMA
Jump to navigation Jump to search
No edit summary
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
This article is an overview of physics related constants and variables.
This article is an overview of physics related constants.


==Variables==
* [[Box2D Constants|Box2D]], for the free and open source Box2D physics extension
These variables work like regular speed and direction and you can set them through code, they exist in all physics objects:
* [[Bullet Constants|Bullet]], for the Bullet real time destruction physics extension
*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===
* [[Studio Physics Constants|GameMaker: Studio Physics]], for constants related to the GameMaker physics extension provided for compatibility
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===
{| class="wikitable" cellpadding=5 cellspacing=0 border=0 style="background-color:#FAD796; border: 2px; border-style: solid; border-color:gray;"
|- cellpadding=5 cellspacing=0 border=0 style="background-color:black; color:white;"
| '''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===
{| class="wikitable" cellpadding=5 cellspacing=0 border=0 style="background-color:#FAD796; border: 2px; border-style: solid; border-color:gray;"
|- cellpadding=5 cellspacing=0 border=0 style="background-color:black; color:white;"
| '''Constant'''
| '''Description'''
|-
|'''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
|}
 
===Revolute===
{| class="wikitable" cellpadding=5 cellspacing=0 border=0 style="background-color:#FAD796; border: 2px; border-style: solid; border-color:gray;"
|- cellpadding=5 cellspacing=0 border=0 style="background-color:black; color:white;"
| '''Constant'''
| '''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.
|}
 
===Prismatic===
{| class="wikitable" cellpadding=5 cellspacing=0 border=0 style="background-color:#FAD796; border: 2px; border-style: solid; border-color:gray;"
|- cellpadding=5 cellspacing=0 border=0 style="background-color:black; color:white;"
| '''Constant'''
| '''Description'''
|-
|'''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.
|}
 
===Pulley===
{| class="wikitable" cellpadding=5 cellspacing=0 border=0 style="background-color:#FAD796; border: 2px; border-style: solid; border-color:gray;"
|- cellpadding=5 cellspacing=0 border=0 style="background-color:black; color:white;"
| '''Constant'''
| '''Description'''
|-
|'''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.
|}
 
===Distance===
{| class="wikitable" cellpadding=5 cellspacing=0 border=0 style="background-color:#FAD796; border: 2px; border-style: solid; border-color:gray;"
|- cellpadding=5 cellspacing=0 border=0 style="background-color:black; color:white;"
| '''Constant'''
| '''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_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.
|}

Latest revision as of 19:35, 17 September 2013

This article is an overview of physics related constants.

  • Box2D, for the free and open source Box2D physics extension
  • Bullet, for the Bullet real time destruction physics extension