Skip to content

Studio_Physics_Constants

hugh greene edited this page Jun 20, 2022 · 1 revision

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

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
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
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_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_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_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.
Clone this wiki locally