Packageorg.rapidphysics
Classpublic class RapidU
InheritanceRapidU Inheritance Object



Public Methods
 MethodDefined By
  
clamp(value:Number, min:Number, max:Number):Number
[static] Given a value passed in, returns a Number between min and max (inclusive)
RapidU
  
clampUInt(value:uint, min:uint, max:uint):uint
[static]
RapidU
  
dot(p1:Point, p2:Point):Number
[static] Calculates the dot product for two Point vectors
RapidU
  
formatTime(value:Number):String
[static]
RapidU
  
reflect(v:Point, n:Point, result:Point):void
[static] Calculates the reflection vector
RapidU
  
reflectPosition(position:Point, q:Point, n:Point):void
[static]
RapidU
  
sameNumber(n1:Number, n2:Number, error:Number = 0.0):Boolean
[static] Tells you if two numbers are the same
RapidU
  
samePoint(p1:Point, p2:Point, error:Number = 0.0):Boolean
[static] Tells you if two Point objects are the same
RapidU
  
timeOfCollision(start:Point, end:Point, posOfCollision:Point):Number
[static] Calculates a number representing the time of collision across 3 points
RapidU
Public Constants
 ConstantDefined By
  HOURS_PER_MINUTE : Number = 0.016666666666666666
[static]
RapidU
  MILLS_PER_SECOND : Number = 1000
[static]
RapidU
  MINUTES_PER_SECOND : Number = 0.016666666666666666
[static]
RapidU
Method Detail
clamp()method
public static function clamp(value:Number, min:Number, max:Number):Number

Given a value passed in, returns a Number between min and max (inclusive)

Parameters

value:Number — the Number you want to evaluate
 
min:Number — the minimum number that should be returned
 
max:Number — the maximum number that should be returned

Returns
Number — value clamped between min and max
clampUInt()method 
public static function clampUInt(value:uint, min:uint, max:uint):uint

Parameters

value:uint
 
min:uint
 
max:uint

Returns
uint
dot()method 
public static function dot(p1:Point, p2:Point):Number

Calculates the dot product for two Point vectors

Parameters

p1:Point
 
p2:Point

Returns
Number
formatTime()method 
public static function formatTime(value:Number):String

Parameters

value:Number — A Number representing the amount of time passed in seconds

Returns
String — A String formatted in hours:minutes:seconds:mills
reflect()method 
public static function reflect(v:Point, n:Point, result:Point):void

Calculates the reflection vector

Parameters

v:Point — vector v
 
n:Point — vector n, must be normalized
 
result:Point — where the results are stored

reflectPosition()method 
public static function reflectPosition(position:Point, q:Point, n:Point):void

Parameters

position:Point — The position that you want modified. The result is stored here too!
 
q:Point — The point of collision
 
n:Point — The normal of the surgace, must be normalized

sameNumber()method 
public static function sameNumber(n1:Number, n2:Number, error:Number = 0.0):Boolean

Tells you if two numbers are the same

Parameters

n1:Number
 
n2:Number
 
error:Number (default = 0.0)

Returns
Boolean
samePoint()method 
public static function samePoint(p1:Point, p2:Point, error:Number = 0.0):Boolean

Tells you if two Point objects are the same

Parameters

p1:Point
 
p2:Point
 
error:Number (default = 0.0)

Returns
Boolean
timeOfCollision()method 
public static function timeOfCollision(start:Point, end:Point, posOfCollision:Point):Number

Calculates a number representing the time of collision across 3 points

Parameters

start:Point
 
end:Point
 
posOfCollision:Point

Returns
Number — the time that the collusion occured, between 0 and 1
Constant Detail
HOURS_PER_MINUTEConstant
public static const HOURS_PER_MINUTE:Number = 0.016666666666666666

MILLS_PER_SECONDConstant 
public static const MILLS_PER_SECOND:Number = 1000

MINUTES_PER_SECONDConstant 
public static const MINUTES_PER_SECOND:Number = 0.016666666666666666