Class: MSPhysics::Gear
Overview
Constant Summary
- DEFAULT_RATIO =
1.0
Class Method Summary collapse
-
.all_gears ⇒ Array<Gear>
Get all gears.
-
.gear_by_address(address) ⇒ Gear?
Get gear by address.
-
.validate(gear, world = nil) ⇒ void
private
Verify that gear is valid.
Instance Method Summary collapse
-
#address ⇒ Fixnum
Get pointer the gear.
-
#destroy ⇒ void
Destroy gear.
-
#initialize(world, joint1, joint2) ⇒ Gear
constructor
A new instance of Gear.
-
#joint1 ⇒ MSPhysics::Joint
Get the first joint the gear is linked to.
-
#joint2 ⇒ MSPhysics::Joint
Get the second joint the gear is linked to.
-
#ratio ⇒ Numeric
Get gear ratio.
-
#ratio=(value) ⇒ Object
Set gear ratio.
-
#valid? ⇒ Boolean
Determine whether gear is valid.
-
#world ⇒ MSPhysics::World
Get the world the gear is associated to.
Methods inherited from Entity
Constructor Details
#initialize(world, joint1, joint2) ⇒ Gear
Returns a new instance of Gear
Class Method Details
.all_gears ⇒ Array<Gear>
Gears that do not have a MSPhysics::Gear instance are not included in the array.
Get all gears.
.gear_by_address(address) ⇒ Gear?
Get gear by address.
.validate(gear, 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 gear is valid.
Instance Method Details
#address ⇒ Fixnum
Get pointer the gear.
#destroy ⇒ void
This method returns an undefined value.
Destroy gear.
#joint1 ⇒ MSPhysics::Joint
Get the first joint the gear is linked to.
#joint2 ⇒ MSPhysics::Joint
Get the second joint the gear is linked to.
#ratio ⇒ Numeric
Get gear ratio.
#ratio=(value) ⇒ Object
Set gear ratio.
#valid? ⇒ Boolean
Determine whether gear is valid.
#world ⇒ MSPhysics::World
Get the world the gear is associated to.