Sha256: e203ebe96a8b00ae8b39a87100dac206d1d5eeb116776332305d7c77ee08bede

Contents?: true

Size: 629 Bytes

Versions: 20

Compression:

Stored size: 629 Bytes

Contents

#
# Copyright (c) 2001 by Jim Menard <jimm@io.com>
#
# Released under the same license as Ruby. See
# http://www.ruby-lang.org/en/LICENSE.txt.
#

require './Point'

class Thing

    attr_accessor :position, :vector, :view

    def initialize(pos = nil, vec = nil)
	@position = pos ? pos : Point.new
	@vector = vec ? vec : Point.new
    end

    def move
	position.x += vector.x
	position.y += vector.y
	position.z += vector.z
    end

    def draw
	view.draw() if view
    end

    def pixelsPerSecToPixelsPerMove(pixelsPerSecond)
	pps = (pixelsPerSecond.to_f / (1000.0 / 75.0)).to_i
	pps = 1 if pps == 0
	return pps
    end
end

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
rock-qtbindings-4.8.6.5 examples/ruboids/ruboids/Thing.rb
qtbindings-4.8.6.5 examples/ruboids/ruboids/Thing.rb
qtbindings-4.8.6.4 examples/ruboids/ruboids/Thing.rb
qtbindings-4.8.6.2 examples/ruboids/ruboids/Thing.rb
qtbindings-4.8.6.1 examples/ruboids/ruboids/Thing.rb
qtbindings-4.8.6.0 examples/ruboids/ruboids/Thing.rb
qtbindings-4.8.6.0-x86-mingw32 examples/ruboids/ruboids/Thing.rb
qtbindings-4.8.5.2 examples/ruboids/ruboids/Thing.rb
qtbindings-4.8.5.2-x86-mingw32 examples/ruboids/ruboids/Thing.rb
qtbindings-4.8.5.1 examples/ruboids/ruboids/Thing.rb
qtbindings-4.8.5.0 examples/ruboids/ruboids/Thing.rb
qtbindings-4.8.3.0-x86-mingw32 examples/ruboids/ruboids/Thing.rb
qtbindings-4.8.3.0 examples/ruboids/ruboids/Thing.rb
qtbindings-4.6.3.4-x86-mingw32 examples/ruboids/ruboids/Thing.rb
qtbindings-4.6.3.4 examples/ruboids/ruboids/Thing.rb
qtbindings-4.6.3.3 examples/ruboids/ruboids/Thing.rb
qtbindings-4.6.3.2-x86-mingw32 examples/ruboids/ruboids/Thing.rb
qtbindings-4.6.3.2 examples/ruboids/ruboids/Thing.rb
qtbindings-4.6.3.1 examples/ruboids/ruboids/Thing.rb
qtbindings-4.6.3.1-x86-mingw32 examples/ruboids/ruboids/Thing.rb