Packageorg.generalrelativity.foam.dynamics.element.body
Classpublic class Circle
InheritanceCircle Inheritance RigidBody Inheritance SimpleParticle



Public Properties
 PropertyDefined by
 Inheritedav : Number
RigidBody
  collisionTypeID : String
[read-only]
Circle
 Inheritededges : Array
RigidBody
 Inheritedelasticity : Number
SimpleParticle
 Inheritedforce : Vector
SimpleParticle
 Inheritedfriction : Number
SimpleParticle
 InheritedI : Number
RigidBody
 InheritedinverseI : Number
RigidBody
 InheritedinverseMass : Number
SimpleParticle
 Inheritedmass : Number
SimpleParticle
 Inheritedposition : Vector
SimpleParticle
 Inheritedq : Number
RigidBody
  radius : Number
circle's radius
Circle
 Inheritedrotation : RotationMatrix
Gets the rotation matrix of the body

Because the creation of a rotation matrix involves 2 trigonometric function calls, it's worthwhile to do a check to see if we need to create a new rotation matrix.

RigidBody
 Inheritedstate : Array
Gets the state of the differential equation

Consider a particle with position x and velocity v.

SimpleParticle
 Inheritedtorque : Number
RigidBody
 Inheritedvelocity : Vector
SimpleParticle
 Inheritedvertices : Array
RigidBody
 Inheritedvx : Number
SimpleParticle
 Inheritedvy : Number
SimpleParticle
 Inheritedx : Number
Note that these values that constitute this IODE's state use getters/setters that access specific indices within _state.
SimpleParticle
 Inheritedy : Number
SimpleParticle
Protected Properties
 PropertyDefined by
 Inherited_edges : Array
body edges
RigidBody
 Inherited_elasticity : Number
elastic coefficient of particle (used in collision response)
SimpleParticle
 Inherited_force : Vector
holds all accummulate forces
SimpleParticle
 Inherited_friction : Number
frictional coefficient (used in collision response)
SimpleParticle
 Inherited_generators : Array
holds all IForceGenerators affecting this particle
SimpleParticle
 Inherited_I : Number
inertia tensor
RigidBody
 Inherited_inverseI : Number
inverse inertia tensor
RigidBody
 Inherited_inverseMass : Number
holds the inverse mass- this is an optimization as multiplication is faster than division and we can calculate this offline
SimpleParticle
 Inherited_mass : Number
holds the mass of the particle
SimpleParticle
 Inherited_rotation : RotationMatrix
rotation matrix of body
RigidBody
 Inherited_state : Array
holds the state of the system
SimpleParticle
 Inherited_torque : Number
torque accumulator
RigidBody
 Inherited_vertices : Array
body vertices
RigidBody
Public Methods
 MethodDefined by
  
Circle(x:Number, y:Number, radius:Number, mass:Number = 100, vx:Number = 0, vy:Number = 0, friction:Number = 0.5, elasticity:Number = 0.15, q:Number = 0, av:Number = 0)
Creates a new RigidBody

This will most likely be the most used element in FOAM.

Circle
 Inherited
Accumulates forces
SimpleParticle
 Inherited
addForce(force:Vector):void
Adds a force to the particle
SimpleParticle
 Inherited
addForceAtPoint(point:Vector, force:Vector):void
Adds a force at a specific point on the body

IF the point specified is not the center of mass (0,0), the force will induce a change in angular velocity as well as linear.

RigidBody
 Inherited
Adds a force generator to influence this particle
SimpleParticle
 Inherited
addTorque(torque:Number):void
Adds torque to the body

This is the rotational equivalent to adding a force

RigidBody
 Inherited
clearForces():void
Clears all forces
SimpleParticle
 Inherited
clearTorque():void
Clears any accumulated torque
RigidBody
 Inherited
getDerivative(state:Array, derivative:Array):void
Gets the derivative of the body

Note that both the state and derivative are longer than in SimpleParticle.

RigidBody
 Inherited
Gets the velocity of the body at a specified point

Note that this point is given in world-coordinates.

RigidBody
 Inherited
Removes a force generator
SimpleParticle
Protected Methods
 MethodDefined by
  
Calculates the inertia tensor
Circle
Property detail
collisionTypeIDproperty
collisionTypeID:String  [read-only]Implementation
    public function get collisionTypeID():String
radiusproperty 
public var radius:Number

circle's radius

Constructor detail
Circle()constructor
public function Circle(x:Number, y:Number, radius:Number, mass:Number = 100, vx:Number = 0, vy:Number = 0, friction:Number = 0.5, elasticity:Number = 0.15, q:Number = 0, av:Number = 0)

Creates a new RigidBody

This will most likely be the most used element in FOAM. It's important to note that most aspects of simulation assume convexity in bodies.

Parameters
x:Number — body's x position
 
y:Number — body's y postiion
 
radius:Number — circle's radius
 
mass:Number (default = 100) — body's mass
 
vx:Number (default = 0) — horizontal velocity,
 
vy:Number (default = 0) — vertical velocity,
 
friction:Number (default = 0.5) — body's orientation (in radians)
 
elasticity:Number (default = 0.15) — body's angular velocity
 
q:Number (default = 0) — body's surface frictional coefficient
 
av:Number (default = 0) — body's elasticity

See also

Method detail
calculateInertiaTensor()method
protected override function calculateInertiaTensor():void

Calculates the inertia tensor

See also

RigidBody.calculateInertiaTensor