Class: MSPhysics::Body
Overview
The Body class represents a physics body in simulation. Every body in simulation is designed to have its own Body object.
Force Control Functions collapse
-
#add_force(*args) ⇒ Boolean
Apply force on the body in Newtons (kg * m/s/s).
-
#add_torque(*args) ⇒ Boolean
Apply torque on the body in Newton-meters (kg * m/s/s * m).
-
#get_force ⇒ Geom::Vector3d
Get the net force, in Newtons, applied on the body after the last world update.
-
#get_torque ⇒ Geom::Vector3d
Get the net torque, in Newton-meters, applied on the body after the last world update.
-
#set_force(*args) ⇒ Boolean
Apply force on the body in Newton (kg * m/s/s).
-
#set_torque(*args) ⇒ Boolean
Apply torque on the body in Newton-meters (kg * m/s/s * m).
Contact Related Functions collapse
-
#contact_points(inc_non_collidable) ⇒ Array<Geom::Point3d>
Get all contact points on the body.
-
#contacts(inc_non_collidable) ⇒ Array<Contact>
Get all contacts on the body.
-
#net_contact_force ⇒ Geom::Vector3d
Get total force generated from contacts on the body.
-
#touching_bodies(inc_non_collidable) ⇒ Array<Body>
Get all bodies that are in contact with this body.
-
#touching_with?(body) ⇒ Boolean
Determine if this body is in contact with another body.
Joint Associated Functions collapse
-
#attach(body) ⇒ MSPhysics::Fixed
Attach a particular body to this body with a Fixed joint.
-
#attached?(body) ⇒ Boolean
Determine whether a particular body is attached to this body.
-
#detach(body) ⇒ Boolean
Detach a particular attached body from this body.
-
#detach_all ⇒ Fixnum
Detach all attached bodies from this body.
-
#look_at(pin_dir, accel = 40, damp = 10, strength = 0.9) ⇒ MSPhysics::UpVector?
Make the body's Z-axis to look in a particular direction.
Class Method Summary collapse
-
.all_bodies ⇒ Array<Body>
Get all bodies.
-
.bodies_aabb_overlap?(body1, body2) ⇒ Boolean
Determine if the bounding boxes of two bodies overlap.
-
.bodies_collidable?(body1, body2) ⇒ Boolean
Determine if two bodies can collide with each other.
-
.bodies_touching?(body1, body2) ⇒ Boolean
Determine if two bodies are in contact.
-
.body_by_address(address) ⇒ Body?
Get body by body address.
-
.closest_points(body1, body2) ⇒ Array<Geom::Point3d>?
Get closest collision points between two bodies.
-
.force_between_bodies(body1, body2) ⇒ Geom::Vector3d
Get contact force between two bodies.
-
.validate(body, world = nil) ⇒ void
private
Verify that body is valid.
-
.validate2(body1, body2, world = nil) ⇒ void
private
Verify that two bodies are valid and unique.
Instance Method Summary collapse
-
#aabb ⇒ Geom::BoundingBox
Get world axes aligned bounding box (AABB) of the body.
-
#actual_matrix_scale ⇒ Geom::Vector3d
Get scale of the body matrix that is a product of group scale and collision scale.
-
#add_impulse(center, delta_vel, timestep) ⇒ Boolean
Add an impulse to a specific point on the body.
-
#add_point_force(point, force) ⇒ Boolean
Add force to a specific point on the body.
-
#address ⇒ Fixnum
Get pointer to the body.
-
#apply_aerodynamics(drag, wind) ⇒ Boolean
Apply fluid resistance to the body.
-
#apply_buoyancy(plane_origin, plane_normal, density, linear_viscosity, angular_viscosity, linear_current, angular_current, timestep) ⇒ Boolean
Apply buoyancy to the body.
-
#apply_pick_and_drag(pick_pt, dest_pt, stiffness, damp, timestep) ⇒ Boolean
Apply pick and drag to the body.
-
#auto_sleep_enabled=(state) ⇒ Object
Set auto sleep state of the body.
-
#auto_sleep_enabled? ⇒ Boolean
Get the auto-sleep state of the body.
-
#clear_non_collidable_bodies ⇒ Fixnum
Remove all bodies from the non-collidable list; the bodies that were set non-collidable by the #set_non_collidable_with function.
-
#collidable=(state) ⇒ Object
Set body collidable.
-
#collidable? ⇒ Boolean
Determine whether body is collidable.
-
#collision_address ⇒ Fixnum
Get pointer to the collision associated with the body.
-
#collision_faces ⇒ Array<Array<Geom::Point3d>>
Get collision faces of the body.
-
#collision_faces2 ⇒ Array<Array<(Array<Geom::Point3d>, Geom::Point3d, Geom::Vector3d, Numeric)>>
Get collision faces of the body.
-
#collision_faces3 ⇒ Array<Array<(Geom::Point3d, Geom::Vector3d, Numeric)>>
Get collision faces of the body.
-
#connected_bodies ⇒ Array<Body>
Get all bodies connected to this body through joints.
-
#connected_joints ⇒ Array<Joint, DoubleJoint>
Get joints whose child bodies associate to this body.
-
#contained_joints ⇒ Array<Joint, DoubleJoint>
Get joints whose parent bodies associate to this body.
-
#context ⇒ BodyContext
Get the associated context.
-
#continuous_collision_check_enabled=(state) ⇒ Object
Enable/disable continuous collision check for this body.
-
#continuous_collision_check_enabled? ⇒ Boolean
Determine whether continuous collision check is enabled for this body.
-
#copy(*args) ⇒ Body
Create a copy of the body.
-
#default_collision_scale ⇒ Geom::Vector3d
Get default scale of the body collision.
-
#density ⇒ Numeric
Get body density in kilograms per cubic meter (kg / m^3).
-
#density=(value) ⇒ Object
Set body density in kilograms per cubic meter (kg / m^3).
-
#destroy(erase_entity = false) ⇒ nil
Destroy the body.
-
#elasticity ⇒ Numeric
Get body coefficient of restitution - bounciness - rebound ratio.
-
#elasticity=(coefficient) ⇒ Object
Set body coefficient of restitution - bounciness - rebound ratio.
-
#friction_enabled=(state) ⇒ Object
Set friction state of the body.
-
#friction_enabled? ⇒ Boolean
Get friction state of the body.
-
#frozen=(state) ⇒ Object
Set body collidable.
-
#frozen? ⇒ Boolean
Determine whether body is frozen.
-
#get_angular_damping ⇒ Geom::Vetor3d
Get the viscous damping coefficient applied to the omega of the body.
-
#get_centre_of_mass ⇒ Geom::Point3d
Get centre of mass of the body in local coordinates.
-
#get_collision_scale ⇒ Geom::Vector3d
Get body collision scale.
-
#get_euler_angles ⇒ Geom::Vector3d
Get body orientation in form of the three Euler angles.
-
#get_linear_damping ⇒ Geom::Vetor3d
Get the viscous damping coefficient applied to the velocity of the body.
-
#get_matrix ⇒ Geom::Transformation
Get body transformation matrix.
-
#get_non_collidable_bodies ⇒ Array<Body>
Get all bodies that are non-collidable with this body; the bodies that were set non-collidable by the #set_non_collidable_with function.
-
#get_omega ⇒ Geom::Vector3d
Get global angular velocity of the body.
-
#get_position(mode = 0) ⇒ Geom::Point3d
Get body position.
-
#get_velocity ⇒ Geom::Vector3d
Get global linear velocity of the body.
-
#gravity_enabled=(state) ⇒ Object
Enable/disable gravitational force on this body.
-
#gravity_enabled? ⇒ Boolean
Determine if gravitational force is enabled on this body.
-
#group ⇒ Sketchup::Group, Sketchup::ComponentInstance
Get the group/component associated with the body.
-
#inertia ⇒ Geom::Vector3d
Get body local inertia.
-
#initialize(*args) ⇒ Body
constructor
A new instance of Body.
-
#integrate_velocity(timestep) ⇒ nil
Integrate linear and angular velocity of the body.
-
#kinetic_friction ⇒ Numeric
Get kinetic friction coefficient of the body.
-
#kinetic_friction=(coefficient) ⇒ Object
Set kinetic friction coefficient of the body.
-
#magnet_force ⇒ Numeric
Get the maximum magnet force in Newton to be applied on the surrounding magnetic bodies.
-
#magnet_force=(force) ⇒ Object
Set the maximum magnet force in Newton to be applied on the surrounding magnetic bodies.
-
#magnet_mode ⇒ Fixnum
Get the mode for controlling the way this magnet should work.
-
#magnet_mode=(mode) ⇒ Object
Set the mode for controlling the way this magnet should work.
-
#magnet_range ⇒ Numeric
Get the maximum magnet range in meters.
-
#magnet_range=(range) ⇒ Object
Set the maximum magnet range in meters.
-
#magnet_strength ⇒ Numeric
Get the magnet force magnitude to be applied on the surrounding magnetic bodies.
-
#magnet_strength=(magnitude) ⇒ Object
Set the magnet force magnitude to be applied on the surrounding magnetic bodies.
-
#magnetic=(state) ⇒ Object
Set body magnetic.
-
#magnetic? ⇒ Boolean
Determine whether body is magnetic.
-
#mass ⇒ Numeric
Get body mass in kilograms (kg).
-
#mass=(value) ⇒ Object
Set body mass in kilograms (kg).
-
#non_collidable_with?(body) ⇒ Boolean
Determine whether this body is non-collidable with a particular body.
-
#normal_matrix ⇒ Geom::transformation
Get body matrix with no scale factors.
-
#point_velocity(point) ⇒ Geom::Vector3d
Get velocity at a specific point on the body.
-
#reset_mass_properties(density) ⇒ Boolean
Reset/recalculate body volume and mass.
-
#rotation ⇒ Array<Numeric>
Get body orientation in form of the unit quaternion.
-
#set_angular_damping(*args) ⇒ nil
Set the viscous damping coefficient applied to the omega of the body.
-
#set_centre_of_mass(*args) ⇒ nil
Set centre of mass of the body in local coordinates.
-
#set_collision_scale(*args) ⇒ nil
Set body collision scale.
-
#set_euler_angles(*args) ⇒ nil
Set body orientation via the three Euler angles.
-
#set_linear_damping(*args) ⇒ Object
Set the viscous damping coefficient applied to the velocity of the body.
-
#set_matrix(matrix) ⇒ nil
Set body transformation matrix.
-
#set_non_collidable_with(body, state) ⇒ nil
Set this body non-collidable with a particular body.
-
#set_omega(*args) ⇒ nil
Set global angular velocity of the body.
-
#set_position(*args) ⇒ nil
Set body position.
-
#set_velocity(*args) ⇒ nil
Set global linear velocity of the body.
-
#sleeping=(state) ⇒ Object
Set body sleeping.
-
#sleeping? ⇒ Boolean
Determine whether body is sleeping.
-
#softness ⇒ Numeric
Get contact softness coefficient of the body.
-
#softness=(coefficient) ⇒ Object
Set contact softness coefficient of the body.
-
#static=(state) ⇒ Object
Set body static.
-
#static? ⇒ Boolean
Determine whether body is static.
-
#static_friction ⇒ Numeric
Get static friction coefficient of the body.
-
#static_friction=(coefficient) ⇒ Object
Set static friction coefficient of the body.
-
#type ⇒ Fixnum
Get body type.
-
#valid? ⇒ Boolean
Determine whether this body is valid - not destroyed.
-
#volume ⇒ Numeric
Get body volume in cubic meters (m^3).
-
#volume=(value) ⇒ Object
Set body volume in cubic meters (m^3).
-
#world ⇒ World
Get world in which the body was created.
Methods inherited from Entity
Constructor Details
Class Method Details
.all_bodies ⇒ Array<Body>
Bodies that do not have a MSPhysics::Body instance are not included in the array.
Get all bodies.
.bodies_aabb_overlap?(body1, body2) ⇒ Boolean
Determine if the bounding boxes of two bodies overlap.
.bodies_collidable?(body1, body2) ⇒ Boolean
Determine if two bodies can collide with each other.
.bodies_touching?(body1, body2) ⇒ Boolean
Determine if two bodies are in contact.
.body_by_address(address) ⇒ Body?
Get body by body address.
.closest_points(body1, body2) ⇒ Array<Geom::Point3d>?
This works with convex and compound bodies only. Nil will be returned if one the passed bodies have a static mesh or a null collision.
Get closest collision points between two bodies.
.force_between_bodies(body1, body2) ⇒ Geom::Vector3d
Get contact force between two bodies.
.validate(body, world = nil) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
Verify that body is valid.
.validate2(body1, body2, world = nil) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
Verify that two bodies are valid and unique.
Instance Method Details
#aabb ⇒ Geom::BoundingBox
Get world axes aligned bounding box (AABB) of the body.
#actual_matrix_scale ⇒ Geom::Vector3d
Get scale of the body matrix that is a product of group scale and collision scale.
#add_force(force) ⇒ Boolean #add_force(fx, fy, fz) ⇒ Boolean
Unlike the #set_force, this function doesn't overwrite original force, but rather adds force to the force accumulator.
Apply force on the body in Newtons (kg * m/s/s).
#add_impulse(center, delta_vel, timestep) ⇒ Boolean
Add an impulse to a specific point on the body.
#add_point_force(point, force) ⇒ Boolean
Add force to a specific point on the body.
#add_torque(torque) ⇒ Boolean #add_torque(tx, ty, tz) ⇒ Boolean
Unlike the #set_torque, this function doesn't overwrite original torque, but rather adds torque to the torque accumulator.
Apply torque on the body in Newton-meters (kg * m/s/s * m).
#address ⇒ Fixnum
Get pointer to the body.
#apply_aerodynamics(drag, wind) ⇒ Boolean
WIP
Apply fluid resistance to the body. The resistance force and torque is based upon the body's linear and angular velocity, orientation of its collision faces, and the drag coefficient.
#apply_buoyancy(plane_origin, plane_normal, density, linear_viscosity, angular_viscosity, linear_current, angular_current, timestep) ⇒ Boolean
Apply buoyancy to the body.
#apply_pick_and_drag(pick_pt, dest_pt, stiffness, damp, timestep) ⇒ Boolean
Apply pick and drag to the body.
#attach(body) ⇒ MSPhysics::Fixed
Attach a particular body to this body with a Fixed joint.
#attached?(body) ⇒ Boolean
Determine whether a particular body is attached to this body.
#auto_sleep_enabled=(state) ⇒ Object
Keeping auto sleep on is a huge performance plus for simulation. Auto sleep enabled is the default state for a created body; however, for player control, AI control or some other special circumstance, the application may want to control the activation/deactivation of the body.
Set auto sleep state of the body. Auto sleep enables body to automatically go to sleep mode when at rest or become active when activated.
#auto_sleep_enabled? ⇒ Boolean
Get the auto-sleep state of the body.
#clear_non_collidable_bodies ⇒ Fixnum
Remove all bodies from the non-collidable list; the bodies that were set non-collidable by the #set_non_collidable_with function.
#collidable=(state) ⇒ Object
Set body collidable.
#collidable? ⇒ Boolean
Determine whether body is collidable.
#collision_address ⇒ Fixnum
Get pointer to the collision associated with the body.
#collision_faces ⇒ Array<Array<Geom::Point3d>>
Get collision faces of the body.
#collision_faces2 ⇒ Array<Array<(Array<Geom::Point3d>, Geom::Point3d, Geom::Vector3d, Numeric)>>
Get collision faces of the body.
#collision_faces3 ⇒ Array<Array<(Geom::Point3d, Geom::Vector3d, Numeric)>>
Get collision faces of the body.
#connected_bodies ⇒ Array<Body>
Get all bodies connected to this body through joints.
#connected_joints ⇒ Array<Joint, DoubleJoint>
Get joints whose child bodies associate to this body.
#contact_points(inc_non_collidable) ⇒ Array<Geom::Point3d>
Get all contact points on the body.
#contacts(inc_non_collidable) ⇒ Array<Contact>
Get all contacts on the body.
#contained_joints ⇒ Array<Joint, DoubleJoint>
Get joints whose parent bodies associate to this body.
#context ⇒ BodyContext
Get the associated context.
#continuous_collision_check_enabled=(state) ⇒ Object
Continuous collision check is known to affect performance. Be cautions when using it. When performing box stacks it's better to reduce simulation update step, to 1/256 for instance, rather than enabling continuous collision check as smaller update step will keep simulation running smoothly while avoiding penetration at the same time.
Enable/disable continuous collision check for this body. Continuous collision check prevents this body from passing through other bodies at high speeds.
#continuous_collision_check_enabled? ⇒ Boolean
Determine whether continuous collision check is enabled for this body. Continuous collision check prevents this body from passing through other bodies at high speeds.
#copy(reapply_forces, type) ⇒ Body #copy(transformation, reapply_forces, type) ⇒ Body
Create a copy of the body.
#default_collision_scale ⇒ Geom::Vector3d
Does not include group scale.
Get default scale of the body collision.
#density ⇒ Numeric
Get body density in kilograms per cubic meter (kg / m^3).
#density=(value) ⇒ Object
Density and mass are correlated. If you change density the mass will automatically be recalculated.
Set body density in kilograms per cubic meter (kg / m^3).
#destroy(erase_entity = false) ⇒ nil
Destroy the body.
#detach(body) ⇒ Boolean
Detach a particular attached body from this body.
#detach_all ⇒ Fixnum
Detach all attached bodies from this body.
#elasticity ⇒ Numeric
Get body coefficient of restitution - bounciness - rebound ratio.
#elasticity=(coefficient) ⇒ Object
Set body coefficient of restitution - bounciness - rebound ratio.
#friction_enabled=(state) ⇒ Object
Set friction state of the body.
#friction_enabled? ⇒ Boolean
Get friction state of the body.
#frozen=(state) ⇒ Object
Set body collidable.
#frozen? ⇒ Boolean
Determine whether body is frozen.
#get_angular_damping ⇒ Geom::Vetor3d
Get the viscous damping coefficient applied to the omega of the body.
#get_centre_of_mass ⇒ Geom::Point3d
Get centre of mass of the body in local coordinates.
#get_collision_scale ⇒ Geom::Vector3d
Does not include group scale.
Get body collision scale.
#get_euler_angles ⇒ Geom::Vector3d
Get body orientation in form of the three Euler angles.
#get_force ⇒ Geom::Vector3d
Get the net force, in Newtons, applied on the body after the last world update.
#get_linear_damping ⇒ Geom::Vetor3d
Get the viscous damping coefficient applied to the velocity of the body.
#get_matrix ⇒ Geom::Transformation
Get body transformation matrix.
#get_non_collidable_bodies ⇒ Array<Body>
Get all bodies that are non-collidable with this body; the bodies that were set non-collidable by the #set_non_collidable_with function.
#get_omega ⇒ Geom::Vector3d
Get global angular velocity of the body.
#get_position(mode = 0) ⇒ Geom::Point3d
Get body position.
#get_torque ⇒ Geom::Vector3d
Get the net torque, in Newton-meters, applied on the body after the last world update.
#get_velocity ⇒ Geom::Vector3d
Get global linear velocity of the body.
#gravity_enabled=(state) ⇒ Object
Enable/disable gravitational force on this body.
#gravity_enabled? ⇒ Boolean
Determine if gravitational force is enabled on this body.
#group ⇒ Sketchup::Group, Sketchup::ComponentInstance
Get the group/component associated with the body.
#inertia ⇒ Geom::Vector3d
Inertia is the rotational equivalent of mass. It may be used for damping angular velocity through applying dissipative torque.
If the body is static or has a zero mass, the magnitude of the return inertia will be zero.
Get body local inertia.
#integrate_velocity(timestep) ⇒ nil
For this function to have an effect, the body must be kinematic and have a non-zero mass (non-static).
Integrate linear and angular velocity of the body.
#kinetic_friction ⇒ Numeric
Get kinetic friction coefficient of the body.
#kinetic_friction=(coefficient) ⇒ Object
Set kinetic friction coefficient of the body.
#look_at(pin_dir, accel = 40, damp = 10, strength = 0.9) ⇒ MSPhysics::UpVector?
Make the body's Z-axis to look in a particular direction.
#magnet_force ⇒ Numeric
This option has an effect if and only if magnet_mode is set to 1.
Get the maximum magnet force in Newton to be applied on the surrounding magnetic bodies.
#magnet_force=(force) ⇒ Object
This option has an effect if and only if magnet_mode is set to 1.
Set the maximum magnet force in Newton to be applied on the surrounding magnetic bodies.
#magnet_mode ⇒ Fixnum
Get the mode for controlling the way this magnet should work.
-
1; to have the magnet force be calculated with the following equation: actual_magnet_force = f * (d - r)^2 / r^2; where f is the maximum magnet force (in Newtons), d is the distance between this magnet and a magnetic body (in meters), and r is the maximum magnet range (in meters). In this mode, the magnet_force and magnet_range methods are used for controlling the magnet.
-
2; to have magnet force be computed with a slightly different equation: actual_magnet_force = s / d^2; where s is the magnet strength and d is the distance between this magnet and a magnetic body (in meters). In this mode, the magnet_strength method must be used for controlling the magnet.
#magnet_mode=(mode) ⇒ Object
Set the mode for controlling the way this magnet should work.
-
Pass 1 to have the magnet force be calculated with the following equation: actual_magnet_force = f * (d - r)^2 / r^2; where f is the maximum magnet force (in Newtons), d is the distance between this magnet and a magnetic body (in meters), and r is the maximum magnet range (in meters). In this mode, the magnet_force and magnet_range methods are used for controlling the magnet.
-
Pass 2 to have magnet force be computed with a slightly different equation: actual_magnet_force = s / d^2; where s is the magnet strength and d is the distance between this magnet and a magnetic body (in meters). In this mode, the magnet_strength method must be used for controlling the magnet.
#magnet_range ⇒ Numeric
This option has an effect if and only if magnet_mode is set to 1.
Get the maximum magnet range in meters. Magnet force is distributed along the magnet range. Magnetic bodies outside the magnet range are not affected.
#magnet_range=(range) ⇒ Object
This option has an effect if and only if magnet_mode is set to 1.
Set the maximum magnet range in meters. Magnet force is distributed along the magnet range. Magnetic bodies outside the magnet range are not affected.
#magnet_strength ⇒ Numeric
This option has an effect if and only if magnet_mode is set to 2.
Get the magnet force magnitude to be applied on the surrounding magnetic bodies.
#magnet_strength=(magnitude) ⇒ Object
This option has an effect if and only if magnet_mode is set to 2.
Set the magnet force magnitude to be applied on the surrounding magnetic bodies.
#magnetic=(state) ⇒ Object
Set body magnetic. Magnetic bodies will be affected by other bodies with magnetism.
#magnetic? ⇒ Boolean
Determine whether body is magnetic.
#mass ⇒ Numeric
Get body mass in kilograms (kg).
#mass=(value) ⇒ Object
Mass and density are correlated. If you change mass the density will automatically be recalculated.
Set body mass in kilograms (kg).
#net_contact_force ⇒ Geom::Vector3d
Get total force generated from contacts on the body.
#non_collidable_with?(body) ⇒ Boolean
Determine whether this body is non-collidable with a particular body.
#normal_matrix ⇒ Geom::transformation
Get body matrix with no scale factors.
#point_velocity(point) ⇒ Geom::Vector3d
Get velocity at a specific point on the body.
#reset_mass_properties(density) ⇒ Boolean
Reset/recalculate body volume and mass.
#rotation ⇒ Array<Numeric>
Get body orientation in form of the unit quaternion.
#set_angular_damping(damp) ⇒ nil #set_angular_damping(dx, dy, dz) ⇒ nil
Set the viscous damping coefficient applied to the omega of the body.
#set_centre_of_mass(centre) ⇒ nil #set_velocity(px, py, pz) ⇒ nil
Set centre of mass of the body in local coordinates.
#set_collision_scale(scale) ⇒ nil #set_collision_scale(sx, sy, sz) ⇒ nil
Does not include group scale.
Set body collision scale.
#set_euler_angles(angles) ⇒ nil #set_euler_angles(roll, yaw, pitch) ⇒ nil
The angles are assumed in radians.
Set body orientation via the three Euler angles.
#set_force(force) ⇒ Boolean #set_force(fx, fy, fz) ⇒ Boolean
Unlike the #add_force, this function overwrites original force, thus discarding the previously applied force.
Apply force on the body in Newton (kg * m/s/s).
#set_linear_damping(damp) ⇒ Object #set_linear_damping(dx, dy, dz) ⇒ Object
Set the viscous damping coefficient applied to the velocity of the body.
#set_matrix(matrix) ⇒ nil
Set body transformation matrix.
#set_non_collidable_with(body, state) ⇒ nil
Set this body non-collidable with a particular body.
#set_omega(omega) ⇒ nil #set_omega(vx, vy, vz) ⇒ nil
Set global angular velocity of the body.
#set_position(position, mode = 0) ⇒ nil #set_position(px, py, pz, mode = 0) ⇒ nil
Set body position.
#set_torque(torque) ⇒ Boolean #set_torque(tx, ty, tz) ⇒ Boolean
Unlike the #add_torque, this function overwrites original torque, thus discarding the previously applied torque.
Apply torque on the body in Newton-meters (kg * m/s/s * m).
#set_velocity(velocity) ⇒ nil #set_velocity(vx, vy, vz) ⇒ nil
Set global linear velocity of the body.
#sleeping=(state) ⇒ Object
This function can only set body active, the sleeping is controlled by equilibrium.
Set body sleeping.
#sleeping? ⇒ Boolean
Determine whether body is sleeping. Sleeping bodies are bodies at rest.
#softness ⇒ Numeric
Get contact softness coefficient of the body.
#softness=(coefficient) ⇒ Object
Set contact softness coefficient of the body.
#static=(state) ⇒ Object
Set body static.
#static? ⇒ Boolean
Determine whether body is static.
#static_friction ⇒ Numeric
Get static friction coefficient of the body.
#static_friction=(coefficient) ⇒ Object
Set static friction coefficient of the body.
#touching_bodies(inc_non_collidable) ⇒ Array<Body>
Get all bodies that are in contact with this body.
#touching_with?(body) ⇒ Boolean
Determine if this body is in contact with another body.
#type ⇒ Fixnum
Get body type.
#valid? ⇒ Boolean
Determine whether this body is valid - not destroyed.
#volume ⇒ Numeric
Get body volume in cubic meters (m^3).
#volume=(value) ⇒ Object
Volume and mass are correlated. If you change volume the mass will automatically be recalculated.
Set body volume in cubic meters (m^3).
#world ⇒ World
Get world in which the body was created.