Class: MSPhysics::World
- Defined in:
- RubyExtension/MSPhysics/world.rb
Overview
Class Method Summary collapse
-
.all_worlds ⇒ Array<World>
Get all worlds.
-
.validate(world) ⇒ void
private
Verify that world is valid.
-
.world_by_address(address) ⇒ World?
Get world by world address.
Instance Method Summary collapse
-
#aabb ⇒ Geom::BoundingBox?
Get world axes aligned bounding box, a bounding box in which all the bodies are included.
-
#add_explosion(center_point, blast_radius, blast_force) ⇒ Boolean
Add an explosion impulse at particular point in the world.
-
#address ⇒ Fixnum
Get pointer to the world.
-
#bodies ⇒ Array<Body>
Get all bodies in the world.
-
#bodies_in_aabb(min, max) ⇒ Array<Body>
Get all bodies in a particular bounds.
-
#body_count ⇒ Fixnum
Get the number of bodies in the world.
-
#constraint_count ⇒ Fixnum
Get the number of constraints in the world.
-
#contact_merge_tolerance ⇒ Numeric
Get world contact merge tolerance.
-
#contact_merge_tolerance=(tolerance) ⇒ Object
Set world contact merge tolerance.
-
#continuous_convex_ray_cast(body, transformation, target, max_hits = 16) ⇒ Array<Hit>
Shoot a convex body from point1 to point2 and get all intersections.
-
#continuous_ray_cast(point1, point2) ⇒ Array<Hit>
Shoot a ray from point1 to point2 and get all intersections.
-
#convex_ray_cast(body, transformation, target) ⇒ Hit?
Shoot a convex body from point1 to point2 and get the closest intersection.
-
#cur_threads_count ⇒ Fixnum
Get the number of threads currently used by the world.
-
#default_material_id ⇒ Fixnum
Get world default contact material id.
-
#destroy ⇒ nil
Destroy the world.
-
#destroy_all_bodies ⇒ Fixnum
Destroy all bodies in the world.
-
#gears ⇒ Array<Gear>
Get all gears in the world.
-
#get_gravity ⇒ Geom::Vector3d
Get world gravity.
-
#initialize(scale = 1) ⇒ World
constructor
A new instance of World.
-
#joints ⇒ Array<Joint>
Get all joints in the world.
-
#material_thickness ⇒ Numeric
Get world material thickness in meters, an imaginary thickness between the collision geometry of two colliding bodies.
-
#material_thickness=(thickness) ⇒ Object
Set world material thickness in meters, an imaginary thickness between the collision geometry of two colliding bodies.
-
#max_possible_threads_count ⇒ Fixnum
Get the maximum possible number of threads to be used by the world.
-
#max_threads_count ⇒ Fixnum
Get the desired maximum number of threads to be used by the world.
-
#max_threads_count=(count) ⇒ Object
Set the desired maximum number of threads to be used by the world.
-
#ray_cast(point1, point2) ⇒ Hit?
Shoot a ray from point1 to point2 and get the closest intersection.
-
#scale ⇒ Numeric
Get world scale.
-
#serialize_to_file(full_path) ⇒ nil
Serialize world into file.
-
#set_gravity(*args) ⇒ nil
Set world gravity.
-
#solver_model ⇒ Fixnum
Get world solver model.
-
#solver_model=(model) ⇒ Object
Set world solver model.
-
#time ⇒ Numeric
Get world elapsed time in seconds.
-
#update(timestep) ⇒ Numeric
Update world by a time step in seconds.
-
#valid? ⇒ Boolean
Determine if the world is valid (not destroyed).
Methods inherited from Entity
Constructor Details
#initialize(scale = 1) ⇒ World
Returns a new instance of World
Class Method Details
.all_worlds ⇒ Array<World>
Worlds that do not have a MSPhysics::World instance are not included in the array.
Get all worlds.
.validate(world) ⇒ 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 world is valid.
.world_by_address(address) ⇒ World?
Get world by world address.
Instance Method Details
#aabb ⇒ Geom::BoundingBox?
Get world axes aligned bounding box, a bounding box in which all the bodies are included.
#add_explosion(center_point, blast_radius, blast_force) ⇒ Boolean
Add an explosion impulse at particular point in the world.
#address ⇒ Fixnum
Get pointer to the world.
#bodies ⇒ Array<Body>
Bodies that do not have a Body instance are not included in the array.
Get all bodies in the world.
#bodies_in_aabb(min, max) ⇒ Array<Body>
Get all bodies in a particular bounds.
#body_count ⇒ Fixnum
Get the number of bodies in the world.
#constraint_count ⇒ Fixnum
Get the number of constraints in the world.
#contact_merge_tolerance ⇒ Numeric
Get world contact merge tolerance.
#contact_merge_tolerance=(tolerance) ⇒ Object
Set world contact merge tolerance.
#continuous_convex_ray_cast(body, transformation, target, max_hits = 16) ⇒ Array<Hit>
If given body does not have a convex collision, the function will return an empty array.
Shoot a convex body from point1 to point2 and get all intersections.
#continuous_ray_cast(point1, point2) ⇒ Array<Hit>
Shoot a ray from point1 to point2 and get all intersections.
#convex_ray_cast(body, transformation, target) ⇒ Hit?
If given body does not have a convex collision, the function will return nil.
Shoot a convex body from point1 to point2 and get the closest intersection.
#cur_threads_count ⇒ Fixnum
Get the number of threads currently used by the world.
#default_material_id ⇒ Fixnum
Get world default contact material id.
#destroy ⇒ nil
Destroy the world.
#destroy_all_bodies ⇒ Fixnum
Destroy all bodies in the world.
#gears ⇒ Array<Gear>
Gears that do not have a Gear instance are not included in the array.
Get all gears in the world.
#get_gravity ⇒ Geom::Vector3d
Get world gravity.
#joints ⇒ Array<Joint>
Joints that do not have a Joint instance are not included in the array.
Get all joints in the world.
#material_thickness ⇒ Numeric
Get world material thickness in meters, an imaginary thickness between the collision geometry of two colliding bodies.
#material_thickness=(thickness) ⇒ Object
Set world material thickness in meters, an imaginary thickness between the collision geometry of two colliding bodies.
#max_possible_threads_count ⇒ Fixnum
Get the maximum possible number of threads to be used by the world.
#max_threads_count ⇒ Fixnum
Get the desired maximum number of threads to be used by the world.
#max_threads_count=(count) ⇒ Object
Set the desired maximum number of threads to be used by the world.
#ray_cast(point1, point2) ⇒ Hit?
Shoot a ray from point1 to point2 and get the closest intersection.
#scale ⇒ Numeric
Get world scale.
#serialize_to_file(full_path) ⇒ nil
Serialize world into file.
#set_gravity(acceleration) ⇒ nil #set_gravity(ax, ay, az) ⇒ nil
Set world gravity.
#solver_model ⇒ Fixnum
Get world solver model.
#solver_model=(model) ⇒ Object
Set world solver model.
#time ⇒ Numeric
Get world elapsed time in seconds.
#update(timestep) ⇒ Numeric
The smaller the time step the more accurate the simulation will be.
Update world by a time step in seconds.
#valid? ⇒ Boolean
Determine if the world is valid (not destroyed).