Rail joint
ep_railjoint_create
ep_railjoint_create(world_id, body1_id, body2_id, x1, y1, x2a, y2a, x2b, y2b)
Creates a new rail joint.
Returns the id of the new rail joint.
-
world_id: The id of the world.
-
body1_id: The id of the first body.
-
body2_id: The id of the second body.
-
x1: The x component of the anchor point on the first body.
-
y1: The y component of the anchor point on the first body.
-
x2a: The x component of the starting point of the rail on the second body.
-
y2a: The y component of the starting point of the rail on the second body.
-
x2b: The x component of the endpoint of the rail on the second body.
-
y2b: The y component of the endpoint of the rail on the second body.
ep_railjoint_destroy
ep_railjoint_destroy(world_id, railjoint_id)
Destroys the rail joint.
-
world_id: The id of the world.
-
railjoint_id: The id of the rail joint.
ep_railjoint_exists
ep_railjoint_exists(world_id, railjoint_id)
Returns whether the rail joint with the given id exists.
-
world_id: The id of the world.
-
railjoint_id: The id of the rail joint.
ep_railjoint_set_max_normal_force
ep_railjoint_set_max_normal_force(world_id, railjoint_id, maxnormalforce)
Changes the maximum normal force of the rail joint.
-
world_id: The id of the world.
-
railjoint_id: The id of the rail joint.
-
maxnormalforce: The new maximum normal force. Use 0 for no limit.
ep_railjoint_set_motor
ep_railjoint_set_motor(world_id, railjoint_id, maxmotorforce, motorvel)
Changes the motor of the rail joint.
-
world_id: The id of the world.
-
railjoint_id: The id of the rail joint.
-
maxmotorforce: The maximum motor force.
-
motorvel: The velocity of the motor.
ep_railjoint_set_limit_settings
ep_railjoint_set_limit_settings(world_id, railjoint_id, contact_threshold, velocity_threshold)
Changes the limit settings of the rail joint.
-
contact_threshold: The contact threshold.
-
velocity_threshold: The velocity threshold.
ep_railjoint_set_lower_limit
ep_railjoint_set_lower_limit(world_id, railjoint_id, maxlimitforce, position, restitution, velocity)
Changes the lower limit of the rail joint.
-
world_id: The id of the world.
-
railjoint_id: The id of the rail joint.
-
maxlimitforce: The maximum limit force. Set this to 0 to disable the limit.
-
position: The position of the limit.
-
restitution: The coefficient of restitution.
-
velocity: The velocity of the limit. You can use this to change the position over time. The position will not be updated automatically, you have to do that yourself.
ep_railjoint_set_upper_limit
ep_railjoint_set_upper_limit(world_id, railjoint_id, maxlimitforce, position, restitution, velocity)
Changes the upper limit of the rail joint.
-
world_id: The id of the world.
-
railjoint_id: The id of the rail joint.
-
maxlimitforce: The maximum limit force. Set this to 0 to disable the limit.
-
position: The position of the limit.
-
restitution: The coefficient of restitution.
-
velocity: The velocity of the limit. You can use this to change the position over time. The position will not be updated automatically, you have to do that yourself.
ep_railjoint_set_lower_spring
ep_railjoint_set_lower_spring(world_id, railjoint_id, k, position, damping)
Changes the lower spring of the rail joint.
-
world_id: The id of the world.
-
railjoint_id: The id of the rail joint.
-
k: The spring constant. Set this to 0 to disable the spring.
-
position: The position of the spring.
-
damping: The damping force of the spring. Set this to 0 to disable damping (not recommended).
ep_railjoint_set_upper_spring
ep_railjoint_set_upper_spring(world_id, railjoint_id, k, position, damping)
Changes the upper spring of the rail joint.
-
world_id: The id of the world.
-
railjoint_id: The id of the rail joint.
-
k: The spring constant. Set this to 0 to disable the spring.
-
position: The position of the spring.
-
damping: The damping force of the spring. Set this to 0 to disable damping (not recommended).
ep_railjoint_get_body1
ep_railjoint_get_body1(world_id, railjoint_id)
Returns the id of the first body connected to the rail joint.
-
world_id: The id of the world.
-
railjoint_id: The id of the rail joint.
ep_railjoint_get_body2
ep_railjoint_get_body2(world_id, railjoint_id)
Returns the id of the second body connected to the rail joint.
-
world_id: The id of the world.
-
railjoint_id: The id of the rail joint.
ep_railjoint_get_position
ep_railjoint_get_position(world_id, railjoint_id)
Returns the current position of the rail joint.
-
world_id: The id of the world.
-
railjoint_id: The id of the rail joint.
ep_railjoint_get_normal_force
ep_railjoint_get_normal_force(world_id, railjoint_id)
Returns the normal force applied during the last step.
-
world_id: The id of the world.
-
railjoint_id: The id of the rail joint.
ep_railjoint_get_motor_force
ep_railjoint_get_motor_force(world_id, railjoint_id)
Returns the motor force applied during the last step.
-
world_id: The id of the world.
-
railjoint_id: The id of the rail joint.
ep_railjoint_get_limit_force
ep_railjoint_get_limit_force(world_id, railjoint_id)
Returns the limit force applied during the last step.
-
world_id: The id of the world.
-
railjoint_id: The id of the rail joint.
ep_railjoint_previous
ep_railjoint_previous(world_id, railjoint_id)
Returns the id of the previous rail joint, or 0 if there is no previous rail joint.
-
world_id: The id of the world.
-
railjoint_id: The id of the rail joint.
ep_railjoint_next
ep_railjoint_next(world_id, railjoint_id)
Returns the id of the next rail joint, or 0 if there is no next rail joint.
-
world_id: The id of the world.
-
railjoint_id: The id of the rail joint.
ep_railjoint_set_uservar
ep_railjoint_set_uservar(world_id, railjoint_id, index, value)
Changes the value of the user variable with the given index.
-
world_id: The id of the world.
-
railjoint_id: The id of the rail joint.
-
index: The index (0-4).
-
value: The new value.
ep_railjoint_get_uservar
ep_railjoint_get_uservar(world_id, railjoint_id, index)
Returns the value of the user variable with the given index.
-
world_id: The id of the world.
-
railjoint_id: The id of the rail joint.
-
index: The index (0-4).
Comments
There are no comments yet.