| Package | org.generalrelativity.foam.dynamics.element.body |
| Class | public class Circle |
| Inheritance | Circle RigidBody SimpleParticle |
| Property | Defined by | ||
|---|---|---|---|
![]() | av : Number | RigidBody | |
| collisionTypeID : String [read-only]
| Circle | ||
![]() | edges : Array | RigidBody | |
![]() | elasticity : Number | SimpleParticle | |
![]() | force : Vector | SimpleParticle | |
![]() | friction : Number | SimpleParticle | |
![]() | I : Number | RigidBody | |
![]() | inverseI : Number | RigidBody | |
![]() | inverseMass : Number | SimpleParticle | |
![]() | mass : Number | SimpleParticle | |
![]() | position : Vector | SimpleParticle | |
![]() | q : Number | RigidBody | |
| radius : Number circle's radius
| Circle | ||
![]() | rotation : 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 | |
![]() | state : Array
Gets the state of the differential equation
Consider a particle with position x and velocity v. | SimpleParticle | |
![]() | torque : Number | RigidBody | |
![]() | velocity : Vector | SimpleParticle | |
![]() | vertices : Array | RigidBody | |
![]() | vx : Number | SimpleParticle | |
![]() | vy : Number | SimpleParticle | |
![]() | x : Number
Note that these values that constitute this IODE's state use getters/setters
that access specific indices within _state.
| SimpleParticle | |
![]() | y : Number | SimpleParticle | |
| Method | Defined 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 | ||
![]() |
accumulateForces():void
Accumulates forces
| SimpleParticle | |
![]() |
Adds a force to the particle
| SimpleParticle | |
![]() |
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 | |
![]() |
addForceGenerator(generator:IForceGenerator):void
Adds a force generator to influence this particle
| SimpleParticle | |
![]() |
addTorque(torque:Number):void
Adds torque to the body
This is the rotational equivalent to adding a force | RigidBody | |
![]() |
clearForces():void
Clears all forces
| SimpleParticle | |
![]() |
clearTorque():void
Clears any accumulated torque
| RigidBody | |
![]() |
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 | |
![]() |
Gets the velocity of the body at a specified point
Note that this point is given in world-coordinates. | RigidBody | |
![]() |
removeForceGenerator(generator:IForceGenerator):void
Removes a force generator
| SimpleParticle | |
| Method | Defined by | ||
|---|---|---|---|
|
calculateInertiaTensor():void
Calculates the inertia tensor
| Circle | ||
| collisionTypeID | property |
collisionTypeID:String [read-only]Implementation
public function get collisionTypeID():String
| radius | property |
public var radius:Numbercircle's radius
| 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.
Parametersx: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
| calculateInertiaTensor | () | method |
protected override function calculateInertiaTensor():voidCalculates the inertia tensor
See also