Class Example::Ramp
In: examples/test_buggy.rb  (CVS)
Parent: Object

Methods

>>   addToSpace   new   removeFromSpace  

Included Modules

ODE

Attributes

body  [R]  The physical body of the ramp
geometry  [R]  The collision geometry of the ramp

Public Class methods

[Source]

# File examples/test_buggy.rb, line 190
        def initialize( world, length=2, width=1.5, height=1 )
            @body = world.createBody
            @geometry = Geometry::Box::new( length, width, height )
            @geometry.body = @body
            @geometry.position = 2, 0, -0.34
            @geometry.rotation = 0, 1, 0, -0.15
        end

Public Instance methods

Add the car to the specified ODE::Space.

[Source]

# File examples/test_buggy.rb, line 206
        def >>( space )
            if space.is_a?( ODE::Space )
                self.addToSpace( space )
            else
                raise "Cannot add the ramp to a %s" % space.class.name
            end

            return self
        end

Add the car to the specified collision space

[Source]

# File examples/test_buggy.rb, line 217
        def addToSpace( space )
            space << @geometry
        end

Remove the car from the specified collision space

[Source]

# File examples/test_buggy.rb, line 222
        def removeFromSpace( space )
            space.removeGeometry( @geometry )
        end

[Validate]