Packageorg.rapidphysics.shapes
Classpublic class RapidLine
InheritanceRapidLine Inheritance RapidObject Inheritance RapidBasic Inheritance Object

Lines have a start point, and an endpoint



Public Properties
 PropertyDefined By
 Inheritedacceleration : Point
Mess with this in your update loop
RapidObject
 Inheritedactive : Boolean
RapidBasic
 Inheritedcenter : Point
Relative to (x,y)
RapidObject
  end : Point
[read-only]
RapidLine
 Inheritedexists : Boolean
RapidBasic
 InheritedfillColor : uint
RapidObject
 Inheritedfixed : Boolean = false
Set to true to prevent this object from moving
RapidObject
 Inheritedheight : Number
Depending on the shape, height can totally be negative!
RapidObject
 InheritedlineColor : uint
0xRRGGBB
RapidObject
 InheritedmaxVelocity : Point
RapidObject
 InheritednextPosition : Point
RapidObject
 InheritednextVelocity : Point
RapidObject
 InheritednextX : Number
RapidObject
 InheritednextY : Number
RapidObject
  normal : Point
The normal for this line
RapidLine
 Inheritedposition : Point
RapidObject
 InheritedpredictMotionFunction : Function
I wrote some code to allow dynamic changes between Euler integration and Verlet integration.
RapidObject
 InheritedprevX : Number
RapidObject
 InheritedprevY : Number
RapidObject
 Inheritedradians : Number
RapidObject
 Inheritedshape : Shape
RapidObject
 Inheritedthickness : Number = 1
RapidObject
 Inheritedvelocity : Point
Mess with this in your update loop
RapidObject
 Inheritedvisible : Boolean
RapidBasic
 Inheritedwidth : Number
Depending on the shape, width can totally be negative!
RapidObject
 Inheritedx : Number
RapidObject
 Inheritedy : Number
RapidObject
Protected Properties
 PropertyDefined By
 Inheritedalpha : Number
RapidObject
 Inherited_point : Point
General usage
RapidObject
Public Methods
 MethodDefined By
  
RapidLine(startX:Number = 0, startY:Number = 0, endX:Number = 0, endY:Number = 0)
RapidLine
  
debugDraw():void
[override]
RapidLine
  
destroy():void
[override]
RapidLine
  
draw():void
[override]
RapidLine
  
getDirection():Point
RapidLine
  
RapidLine
  
intersection(line1:RapidLine, line2:RapidLine):Point
[static] Returns the point of intersection, null otherwise
RapidLine
  
intersects(line1:RapidLine, line2:RapidLine):Boolean
[static] Returns true if the lines intersect
RapidLine
 Inherited
postUpdate():void
[override] Predicts where this object will be by the next preUpdate() Provides enough information to draw physics information, and resolve collisions
RapidObject
 Inherited
preDraw():void
[override]
RapidObject
  
preUpdate():void
[override]
RapidLine
 Inherited
reset(X:Number, Y:Number):void
RapidObject
  
setEnd(X:Number, Y:Number):void
RapidLine
 Inherited
setIntegrationMethod(method:Number):void
takes RapidG.INTEGRATION_EULER, etc.
RapidObject
  
update():void
[override]
RapidLine
Protected Methods
 MethodDefined By
 Inherited
RapidObject
 Inherited
RapidObject
 Inherited
Override this function if your shape has a different center
RapidObject
 Inherited
RapidObject
  
RapidLine
Property Detail
endproperty
end:Point  [read-only]


Implementation
    public function get end():Point
normalproperty 
public var normal:Point

The normal for this line

Constructor Detail
RapidLine()Constructor
public function RapidLine(startX:Number = 0, startY:Number = 0, endX:Number = 0, endY:Number = 0)



Parameters
startX:Number (default = 0)
 
startY:Number (default = 0)
 
endX:Number (default = 0)
 
endY:Number (default = 0)
Method Detail
debugDraw()method
override public function debugDraw():void

destroy()method 
override public function destroy():void

draw()method 
override public function draw():void

getDirection()method 
public function getDirection():Point

Returns
Point
getNormalizedDirection()method 
public function getNormalizedDirection():Point

Returns
Point
intersection()method 
public static function intersection(line1:RapidLine, line2:RapidLine):Point

Returns the point of intersection, null otherwise

Parameters

line1:RapidLine
 
line2:RapidLine

Returns
Point
intersects()method 
public static function intersects(line1:RapidLine, line2:RapidLine):Boolean

Returns true if the lines intersect

Parameters

line1:RapidLine
 
line2:RapidLine

Returns
Boolean
preUpdate()method 
override public function preUpdate():void

setEnd()method 
public function setEnd(X:Number, Y:Number):void

Parameters

X:Number
 
Y:Number

update()method 
override public function update():void

updateNormal()method 
protected function updateNormal():void