Class | ODE::Position |
In: |
lib/ode/position.rb
(CVS)
|
Parent: | ODE::Vector |
Instances of this class represent the position of a point in an ODE::World simulation.
Version | = | /([\d\.]+)/.match( %q{$Revision: 1.2 $} )[1] | Class constants | |
Rcsid | = | %q$Id: position.rb 91 2005-07-27 23:45:01Z ged $ | ||
Origin | = | new(0,0,0) |
Returns the receiver’s distance from the other ODE::Position.
# File lib/ode/position.rb, line 59 def distance( other=Origin ) raise TypeError, "no implicit conversion from %s to %s" % [ other.class.name, self.class.name ] unless other.is_a?( ODE::Position ) return Math::sqrt( (self.x - other.x) ** 2 + (self.y - other.y) ** 2 + (self.z - other.z) ** 2 ) end