Class R.components.physics.CircleBody
Extends
R.components.physics.BaseBody.
An extension of the R.components.physics.BaseBody which creates a circular
rigid body.
Defined in: circlebody.js.
Constructor Attributes | Constructor Name and Description |
---|---|
R.components.physics.CircleBody(name, radius)
A circular rigid body component.
|
- Fields borrowed from class R.components.physics.BaseBody:
- DEFAULT_DENSITY, DEFAULT_FRICTION, DEFAULT_RESTITUTION
- Fields borrowed from class R.components.Base:
- TYPE_COLLIDER, TYPE_INPUT, TYPE_LOGIC, TYPE_RENDERING, TYPE_TRANSFORM
Method Attributes | Method Name and Description |
---|---|
Get a box which bounds the body.
|
|
Get the class name of this object
|
|
Get the radius of the circle's body.
|
|
release()
Releases the component back into the object pool.
|
|
setRadius(radius)
Set the radius of the circle's body.
|
- Methods borrowed from class R.components.physics.BaseBody:
- applyForce, applyImpulse, applyTorque, destroy, execute, getAngularDamping, getBody, getBodyDef, getCenter, getDensity, getFixtureDef, getFriction, getLinearDamping, getLocalOrigin, getMass, getPosition, getRenderComponent, getRestitution, getRotation, isActive, isSleeping, isStatic, setActive, setDamping, setDensity, setFriction, setLocalOrigin, setMass, setPosition, setRenderComponent, setRestitution, setRotation, setStatic, startSimulation, stopSimulation, updateFixture, wakeUp
- Methods borrowed from class R.components.Transform2D:
- getLastPosition, getLastRenderPosition, getRenderPosition, getRenderRotation, getRenderScale, getRenderScaleX, getRenderScaleY, getScale, getScaleX, getScaleY, setLastPosition, setScale
- Methods borrowed from class R.components.Base:
- getGameObject, getHostObject, getPriority, getType, getTypeString, setGameObject, setHostObject, setPriority
- Methods borrowed from class R.engine.BaseObject:
- addEvent, addEvents, getElement, jQ, removeEvent, setElement, triggerEvent, update
- Methods borrowed from class R.engine.PooledObject:
- clearObjectDataModel, getId, getName, getObjectDataModel, getProperties, isDestroyed, setName, setObjectDataModel, toString, toXML
Class Detail
R.components.physics.CircleBody(name, radius)
A circular rigid body component.
- Parameters:
- name
- {String} Name of the component
- radius
- {Number} The radius of the circle
Method Detail
{R.math.Rectangle2D}
getBoundingBox()
Get a box which bounds the body.
- Returns:
- {R.math.Rectangle2D}
{String}
getClassName()
Get the class name of this object
- Returns:
- {String} "R.components.physics.CircleBody"
{Number}
getRadius()
Get the radius of the circle's body.
- Returns:
- {Number}
release()
Releases the component back into the object pool.
setRadius(radius)
Set the radius of the circle's body. Calling this method after
simulation has started on the body has no effect.
- Parameters:
- radius
- {Number} The radius of the body