Class: MSPhysics::Gear

Inherits:
Entity
  • Object
show all
Defined in:
RubyExtension/MSPhysics/gear.rb

Overview

Since:

  • 1.0.0

Constant Summary

DEFAULT_RATIO =

Since:

  • 1.0.0

1.0

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Entity

#inspect, #to_s

Constructor Details

#initialize(world, joint1, joint2) ⇒ Gear

Returns a new instance of Gear

Parameters:

Since:

  • 1.0.0

Class Method Details

.all_gearsArray<Gear>

Note:

Gears that do not have a MSPhysics::Gear instance are not included in the array.

Get all gears.

Returns:

Since:

  • 1.0.0

.gear_by_address(address) ⇒ Gear?

Get gear by address.

Parameters:

  • address (Fixnum)

Returns:

  • (Gear, nil)

    A Gear object if successful.

Raises:

  • (TypeError)

    if the address is invalid.

Since:

  • 1.0.0

.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.

Parameters:

  • gear (Gear)
  • world (World, nil) (defaults to: nil)

    A world the gear ought to belong to or nil.

Raises:

  • (TypeError)

    if gear is invalid or destroyed.

Since:

  • 1.0.0

Instance Method Details

#addressFixnum

Get pointer the gear.

Returns:

  • (Fixnum)

Since:

  • 1.0.0

#destroyvoid

This method returns an undefined value.

Destroy gear.

Since:

  • 1.0.0

#joint1MSPhysics::Joint

Get the first joint the gear is linked to.

Returns:

Since:

  • 1.0.0

#joint2MSPhysics::Joint

Get the second joint the gear is linked to.

Returns:

Since:

  • 1.0.0

#ratioNumeric

Get gear ratio.

Returns:

  • (Numeric)

Since:

  • 1.0.0

#ratio=(value) ⇒ Object

Set gear ratio.

Parameters:

  • value (Numeric)

Since:

  • 1.0.0

#valid?Boolean

Determine whether gear is valid.

Returns:

  • (Boolean)

Since:

  • 1.0.0

#worldMSPhysics::World

Get the world the gear is associated to.

Returns:

Since:

  • 1.0.0