Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Methods

Properties

Constructors

Methods

  • activate(enable: boolean): void
  • activated(): boolean
  • addDistanceJoint(x1: number, y1: number, other: null | RuntimeObject, x2: number, y2: number, length: number, frequency: number, dampingRatio: number, collideConnected: boolean, variable: Variable): void
  • addFrictionJoint(x1: number, y1: number, other: null | RuntimeObject, x2: number, y2: number, maxForce: number, maxTorque: number, collideConnected: boolean, variable: Variable): void
  • addGearJoint(jointId1: any, jointId2: any, ratio: any, collideConnected: any, variable: any): void
  • addMotorJoint(other: null | RuntimeObject, offsetX: number, offsetY: number, offsetAngle: number, maxForce: number, maxTorque: number, correctionFactor: number, collideConnected: boolean, variable: Variable): void
  • addMouseJoint(targetX: number, targetY: number, maxForce: number, frequency: number, dampingRatio: number, variable: Variable): void
  • addPrismaticJoint(x1: number, y1: number, other: null | RuntimeObject, x2: number, y2: number, axisAngle: number, referenceAngle: number, enableLimit: boolean, lowerTranslation: number, upperTranslation: number, enableMotor: boolean, motorSpeed: number, maxMotorForce: number, collideConnected: boolean, variable: Variable): void
  • addPulleyJoint(x1: number, y1: number, other: null | RuntimeObject, x2: number, y2: number, groundX1: number, groundY1: number, groundX2: number, groundY2: number, lengthA: number, lengthB: number, ratio: number, collideConnected: boolean, variable: Variable): void
  • addRevoluteJoint(x: number, y: number, enableLimit: boolean, referenceAngle: number, lowerAngle: number, upperAngle: number, enableMotor: boolean, motorSpeed: number, maxMotorTorque: number, variable: Variable): void
  • addRevoluteJointBetweenTwoBodies(x1: number, y1: number, other: null | RuntimeObject, x2: number, y2: number, enableLimit: boolean, referenceAngle: number, lowerAngle: number, upperAngle: number, enableMotor: boolean, motorSpeed: number, maxMotorTorque: number, collideConnected: boolean, variable: Variable): void
  • addRopeJoint(x1: number, y1: number, other: null | RuntimeObject, x2: number, y2: number, maxLength: number, collideConnected: boolean, variable: Variable): void
  • addWeldJoint(x1: number, y1: number, other: null | RuntimeObject, x2: number, y2: number, referenceAngle: number, frequency: number, dampingRatio: number, collideConnected: boolean, variable: Variable): void
  • addWheelJoint(x1: number, y1: number, other: null | RuntimeObject, x2: number, y2: number, axisAngle: number, frequency: number, dampingRatio: number, enableMotor: boolean, motorSpeed: number, maxMotorTorque: number, collideConnected: boolean, variable: Variable): void
  • applyAngularImpulse(angularImpulse: number): void
  • applyForce(forceX: number, forceY: number, positionX: number, positionY: number): void
  • applyForceTowardPosition(length: number, towardX: number, towardY: number, positionX: number, positionY: number): void
  • applyImpulse(impulseX: number, impulseY: number, positionX: number, positionY: number): void
  • applyImpulseTowardPosition(length: number, towardX: number, towardY: number, positionX: number, positionY: number): void
  • applyPolarForce(angle: number, length: number, positionX: number, positionY: number): void
  • applyPolarImpulse(angle: number, length: number, positionX: number, positionY: number): void
  • applyTorque(torque: number): void
  • b2Vec2(x: number, y: number): b2Vec2
  • b2Vec2Sec(x: number, y: number): b2Vec2
  • createBody(): boolean
  • createShape(): b2FixtureDef
  • enableLayer(layer: number, enable: boolean): void
  • enableMask(mask: number, enable: boolean): void
  • enablePrismaticJointLimits(jointId: string | number, enable: boolean): void
  • enablePrismaticJointMotor(jointId: string | number, enable: boolean): void
  • enableRevoluteJointLimits(jointId: string | number, enable: boolean): void
  • enableRevoluteJointMotor(jointId: string | number, enable: any): void
  • enableSynchronization(enable: boolean): void
  • enableWheelJointMotor(jointId: string | number, enable: any): void
  • getAngularDamping(): number
  • getAngularVelocity(): number
  • getBody(): b2Body
  • getDensity(): number
  • getDistanceJointDampingRatio(jointId: string | number): number
  • getDistanceJointFrequency(jointId: string | number): number
  • getDistanceJointLength(jointId: string | number): number
  • getFriction(): number
  • getFrictionJointMaxForce(jointId: string | number): number
  • getFrictionJointMaxTorque(jointId: string | number): number
  • getGearJointFirstJoint(jointId: string | number): number
  • getGearJointRatio(jointId: string | number): number
  • getGearJointSecondJoint(jointId: string | number): number
  • getGravityScale(): number
  • getGravityX(): number
  • getGravityY(): number
  • getInertia(): number
  • getJointFirstAnchorX(jointId: string | number): number
  • getJointFirstAnchorY(jointId: string | number): number
  • getJointReactionForce(jointId: string | number): number
  • getJointReactionTorque(jointId: string | number): number
  • getJointSecondAnchorX(jointId: string | number): number
  • getJointSecondAnchorY(jointId: string | number): number
  • getLinearDamping(): number
  • getLinearVelocityAngle(): number
  • getLinearVelocityLength(): number
  • getLinearVelocityX(): number
  • getLinearVelocityY(): number
  • getMass(): number
  • getMassCenterX(): number
  • getMassCenterY(): number
  • getMotorJointAngularOffset(jointId: string | number): number
  • getMotorJointCorrectionFactor(jointId: string | number): number
  • getMotorJointMaxForce(jointId: string | number): number
  • getMotorJointMaxTorque(jointId: string | number): number
  • getMotorJointOffsetX(jointId: string | number): number
  • getMotorJointOffsetY(jointId: string | number): number
  • getMouseJointDampingRatio(jointId: string | number): number
  • getMouseJointFrequency(jointId: string | number): number
  • getMouseJointMaxForce(jointId: string | number): number
  • getMouseJointTargetX(jointId: string | number): number
  • getMouseJointTargetY(jointId: string | number): number
  • getName(): string
  • getNameId(): number
  • getPolygon(verticesData: b2Vec2[]): null | Polygon
  • getPrismaticJointAxisAngle(jointId: string | number): number
  • getPrismaticJointMaxMotorForce(jointId: string | number): number
  • getPrismaticJointMaxTranslation(jointId: string | number): number
  • getPrismaticJointMinTranslation(jointId: string | number): number
  • getPrismaticJointMotorForce(jointId: string | number): number
  • getPrismaticJointMotorSpeed(jointId: string | number): number
  • getPrismaticJointReferenceAngle(jointId: string | number): number
  • getPrismaticJointSpeed(jointId: string | number): number
  • getPrismaticJointTranslation(jointId: string | number): number
  • getPulleyJointFirstGroundAnchorX(jointId: string | number): number
  • getPulleyJointFirstGroundAnchorY(jointId: string | number): number
  • getPulleyJointFirstLength(jointId: string | number): number
  • getPulleyJointRatio(jointId: string | number): number
  • getPulleyJointSecondGroundAnchorX(jointId: string | number): number
  • getPulleyJointSecondGroundAnchorY(jointId: string | number): number
  • getPulleyJointSecondLength(jointId: string | number): number
  • getRestitution(): number
  • getRevoluteJointAngle(jointId: string | number): number
  • getRevoluteJointMaxAngle(jointId: string | number): number
  • getRevoluteJointMaxMotorTorque(jointId: string | number): number
  • getRevoluteJointMinAngle(jointId: string | number): number
  • getRevoluteJointMotorSpeed(jointId: string | number): number
  • getRevoluteJointMotorTorque(jointId: string | number): number
  • getRevoluteJointReferenceAngle(jointId: string | number): number
  • getRevoluteJointSpeed(jointId: string | number): number
  • getRopeJointMaxLength(jointId: string | number): number
  • getShapeScale(): number
  • getTimeScale(): number
  • getWeldJointDampingRatio(jointId: string | number): number
  • getWeldJointFrequency(jointId: string | number): number
  • getWeldJointReferenceAngle(jointId: string | number): number
  • getWheelJointAxisAngle(jointId: string | number): number
  • getWheelJointDampingRatio(jointId: string | number): number
  • getWheelJointFrequency(jointId: string | number): number
  • getWheelJointMaxMotorTorque(jointId: string | number): number
  • getWheelJointMotorSpeed(jointId: string | number): number
  • getWheelJointMotorTorque(jointId: string | number): number
  • getWheelJointSpeed(jointId: string | number): number
  • getWheelJointTranslation(jointId: string | number): number
  • getWorldScale(): number
  • hasFixedRotation(): boolean
  • isBullet(): boolean
  • isDynamic(): boolean
  • isJointFirstObject(jointId: string | number): boolean
  • isJointSecondObject(jointId: string | number): boolean
  • isKinematic(): boolean
  • isLinearVelocityAngleAround(degreeAngle: number, tolerance: number): boolean
  • isPolygonConvex(polygon: Polygon): boolean
  • isPrismaticJointLimitsEnabled(jointId: string | number): boolean
  • isPrismaticJointMotorEnabled(jointId: string | number): boolean
  • isRevoluteJointLimitsEnabled(jointId: string | number): boolean
  • isRevoluteJointMotorEnabled(jointId: string | number): boolean
  • isSleeping(): boolean
  • isSleepingAllowed(): boolean
  • isStatic(): boolean
  • isSyncedOverNetwork(): boolean
  • isWheelJointMotorEnabled(jointId: string | number): boolean
  • layerEnabled(layer: number): boolean
  • maskEnabled(mask: number): boolean
  • onActivate(): void
  • onCreated(): void
  • onDeActivate(): void
  • onDestroy(): void
  • This method is called when the owner of the behavior is being removed from the scene and is about to be destroyed/reused later or when the behavior is removed from an object (can happen in case of hot-reloading only. Otherwise, behaviors are just de-activated, not removed. See onDeActivate).

    Returns void

  • onObjectHotReloaded(): void
  • recreateShape(): void
  • removeJoint(jointId: string | number): void
  • setAngularDamping(angularDamping: number): void
  • setAngularVelocity(angularVelocity: number): void
  • setBullet(enable: boolean): void
  • setDensity(density: number): void
  • setDistanceJointDampingRatio(jointId: string | number, dampingRatio: number): void
  • setDistanceJointFrequency(jointId: string | number, frequency: number): void
  • setDistanceJointLength(jointId: string | number, length: number): void
  • setDynamic(): void
  • setFixedRotation(enable: boolean): void
  • setFriction(friction: any): void
  • setFrictionJointMaxForce(jointId: string | number, maxForce: number): void
  • setFrictionJointMaxTorque(jointId: string | number, maxTorque: number): void
  • setGearJointRatio(jointId: string | number, ratio: number): void
  • setGravity(x: number, y: number): void
  • setGravityScale(gravityScale: number): void
  • setKinematic(): void
  • setLinearDamping(linearDamping: number): void
  • setLinearVelocityAngle(angle: number, linearVelocity: number): void
  • setLinearVelocityX(linearVelocityX: number): void
  • setLinearVelocityY(linearVelocityY: number): void
  • setMotorJointAngularOffset(jointId: string | number, offsetAngle: number): void
  • setMotorJointCorrectionFactor(jointId: string | number, correctionFactor: number): void
  • setMotorJointMaxForce(jointId: string | number, maxForce: number): void
  • setMotorJointMaxTorque(jointId: string | number, maxTorque: number): void
  • setMotorJointOffset(jointId: string | number, offsetX: number, offsetY: number): void
  • setMouseJointDampingRatio(jointId: string | number, dampingRatio: number): void
  • setMouseJointFrequency(jointId: string | number, frequency: number): void
  • setMouseJointMaxForce(jointId: string | number, maxForce: number): void
  • setMouseJointTarget(jointId: string | number, targetX: number, targetY: number): void
  • setPrismaticJointLimits(jointId: string | number, lowerTranslation: number, upperTranslation: number): void
  • setPrismaticJointMaxMotorForce(jointId: string | number, maxForce: any): void
  • setPrismaticJointMotorSpeed(jointId: string | number, speed: any): void
  • setRestitution(restitution: number): void
  • setRevoluteJointLimits(jointId: string | number, lowerAngle: number, upperAngle: number): void
  • setRevoluteJointMaxMotorTorque(jointId: string | number, maxTorque: any): void
  • setRevoluteJointMotorSpeed(jointId: string | number, speed: any): void
  • setRopeJointMaxLength(jointId: string | number, maxLength: number): void
  • setShapeScale(shapeScale: number): void
  • setSleepingAllowed(enable: boolean): void
  • setStatic(): void
  • setTimeScale(timeScale: number): void
  • setTimeScaleFromObject(object: any, behaviorName: any, timeScale: any): void
  • setWeldJointDampingRatio(jointId: string | number, dampingRatio: number): void
  • setWeldJointFrequency(jointId: string | number, frequency: number): void
  • setWheelJointDampingRatio(jointId: string | number, dampingRatio: any): void
  • setWheelJointFrequency(jointId: string | number, frequency: any): void
  • setWheelJointMaxMotorTorque(jointId: string | number, maxTorque: number): void
  • setWheelJointMotorSpeed(jointId: string | number, speed: any): void
  • updateBodyFromObject(): void
  • updateFromBehaviorData(oldBehaviorData: any, newBehaviorData: any): boolean
  • updateObjectFromBody(): void
  • usesLifecycleFunction(): boolean
  • Should return false if the behavior does not need any lifecycle function to be called. Default, hidden, "capability" behaviors set it to false. This avoids useless calls to empty lifecycle functions, which would waste CPU time (and have a sizeable impact for example when lots of static instances are living in the scene).

    Returns boolean

Properties

angularDamping: number
bodyType: string
bullet: boolean
canSleep: boolean
collisionTest: (object1: RuntimeObject, object2: RuntimeObject, behaviorName: string) => boolean = Physics2RuntimeBehavior.areObjectsColliding

Type declaration

contactsEndedThisFrame: Physics2RuntimeBehavior[]

Array containing the end of contacts reported by onContactEnd. The array is updated each time the method onContactEnd is called by the listener, which can be called at any time. This array is cleared just before stepping the world.

contactsStartedThisFrame: Physics2RuntimeBehavior[]

Array containing the beginning of contacts reported by onContactBegin. Each contact should be unique to avoid recording glitches where the object loses and regain contact between two frames. The array is updated each time the method onContactBegin is called by the listener, which is only called when stepping the world i.e. in the first preEvent called by a physics behavior. This array is cleared just before stepping the world.

currentContacts: Physics2RuntimeBehavior[]

Array containing the exact current contacts with the objects. It is updated each time the methods onContactBegin and onContactEnd are called by the contact listener.

density: number
destroyedDuringFrameLogic: boolean
fixedRotation: boolean
friction: number
gravityScale: number
layers: number
linearDamping: number
masks: number
name: string
polygon: null | Polygon
polygonOrigin: string
restitution: number
shape: string
shapeDimensionA: any
shapeDimensionB: any
shapeOffsetX: number
shapeOffsetY: number
shapeScale: number = 1
type: string

Constructors

Generated using TypeDoc