Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Methods

Properties

Constructors

Methods

  • activate(enable: boolean): void
  • De/Activate the behavior

    Parameters

    • enable: boolean

      true to enable the behavior, false to disable it

    Returns void

  • activated(): boolean
  • addDistanceJoint(x1: number, y1: number, other: RuntimeObject, x2: number, y2: number, length: number, frequency: number, dampingRatio: number, collideConnected: boolean, variable: Variable): void
  • Parameters

    • x1: number
    • y1: number
    • other: RuntimeObject
    • x2: number
    • y2: number
    • length: number
    • frequency: number
    • dampingRatio: number
    • collideConnected: boolean
    • variable: Variable

    Returns void

  • addFrictionJoint(x1: number, y1: number, other: RuntimeObject, x2: number, y2: number, maxForce: number, maxTorque: number, collideConnected: boolean, variable: Variable): void
  • Parameters

    • x1: number
    • y1: number
    • other: RuntimeObject
    • x2: number
    • y2: number
    • maxForce: number
    • maxTorque: number
    • collideConnected: boolean
    • variable: Variable

    Returns void

  • addGearJoint(jointId1: any, jointId2: any, ratio: any, collideConnected: any, variable: any): void
  • Parameters

    • jointId1: any
    • jointId2: any
    • ratio: any
    • collideConnected: any
    • variable: any

    Returns void

  • addMotorJoint(other: RuntimeObject, offsetX: number, offsetY: number, offsetAngle: number, maxForce: number, maxTorque: number, correctionFactor: number, collideConnected: boolean, variable: Variable): void
  • Parameters

    • other: RuntimeObject
    • offsetX: number
    • offsetY: number
    • offsetAngle: number
    • maxForce: number
    • maxTorque: number
    • correctionFactor: number
    • collideConnected: boolean
    • variable: Variable

    Returns void

  • addMouseJoint(targetX: number, targetY: number, maxForce: number, frequency: number, dampingRatio: number, variable: Variable): void
  • Parameters

    • targetX: number
    • targetY: number
    • maxForce: number
    • frequency: number
    • dampingRatio: number
    • variable: Variable

    Returns void

  • addPrismaticJoint(x1: number, y1: number, other: 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
  • Parameters

    • x1: number
    • y1: number
    • other: 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

    Returns void

  • addPulleyJoint(x1: number, y1: number, other: RuntimeObject, x2: number, y2: number, groundX1: number, groundY1: number, groundX2: number, groundY2: number, lengthA: number, lengthB: number, ratio: number, collideConnected: boolean, variable: Variable): void
  • Parameters

    • x1: number
    • y1: number
    • other: RuntimeObject
    • x2: number
    • y2: number
    • groundX1: number
    • groundY1: number
    • groundX2: number
    • groundY2: number
    • lengthA: number
    • lengthB: number
    • ratio: number
    • collideConnected: boolean
    • variable: Variable

    Returns void

  • addRevoluteJoint(x: number, y: number, enableLimit: boolean, referenceAngle: number, lowerAngle: number, upperAngle: number, enableMotor: boolean, motorSpeed: number, maxMotorTorque: number, variable: Variable): void
  • Parameters

    • x: number
    • y: number
    • enableLimit: boolean
    • referenceAngle: number
    • lowerAngle: number
    • upperAngle: number
    • enableMotor: boolean
    • motorSpeed: number
    • maxMotorTorque: number
    • variable: Variable

    Returns void

  • addRevoluteJointBetweenTwoBodies(x1: number, y1: number, other: RuntimeObject, x2: number, y2: number, enableLimit: boolean, referenceAngle: number, lowerAngle: number, upperAngle: number, enableMotor: boolean, motorSpeed: number, maxMotorTorque: number, collideConnected: boolean, variable: Variable): void
  • Parameters

    • x1: number
    • y1: number
    • other: RuntimeObject
    • x2: number
    • y2: number
    • enableLimit: boolean
    • referenceAngle: number
    • lowerAngle: number
    • upperAngle: number
    • enableMotor: boolean
    • motorSpeed: number
    • maxMotorTorque: number
    • collideConnected: boolean
    • variable: Variable

    Returns void

  • addRopeJoint(x1: number, y1: number, other: RuntimeObject, x2: number, y2: number, maxLength: number, collideConnected: boolean, variable: Variable): void
  • Parameters

    • x1: number
    • y1: number
    • other: RuntimeObject
    • x2: number
    • y2: number
    • maxLength: number
    • collideConnected: boolean
    • variable: Variable

    Returns void

  • addWeldJoint(x1: number, y1: number, other: RuntimeObject, x2: number, y2: number, referenceAngle: number, frequency: number, dampingRatio: number, collideConnected: boolean, variable: Variable): void
  • Parameters

    • x1: number
    • y1: number
    • other: RuntimeObject
    • x2: number
    • y2: number
    • referenceAngle: number
    • frequency: number
    • dampingRatio: number
    • collideConnected: boolean
    • variable: Variable

    Returns void

  • addWheelJoint(x1: number, y1: number, other: RuntimeObject, x2: number, y2: number, axisAngle: number, frequency: number, dampingRatio: number, enableMotor: boolean, motorSpeed: number, maxMotorTorque: number, collideConnected: boolean, variable: Variable): void
  • Parameters

    • x1: number
    • y1: number
    • other: RuntimeObject
    • x2: number
    • y2: number
    • axisAngle: number
    • frequency: number
    • dampingRatio: number
    • enableMotor: boolean
    • motorSpeed: number
    • maxMotorTorque: number
    • collideConnected: boolean
    • variable: Variable

    Returns void

  • applyAngularImpulse(angularImpulse: number): void
  • Parameters

    • angularImpulse: number

    Returns void

  • applyForce(forceX: number, forceY: number, positionX: number, positionY: number): void
  • Parameters

    • forceX: number
    • forceY: number
    • positionX: number
    • positionY: number

    Returns void

  • applyForceTowardPosition(length: number, towardX: number, towardY: number, positionX: number, positionY: number): void
  • Parameters

    • length: number
    • towardX: number
    • towardY: number
    • positionX: number
    • positionY: number

    Returns void

  • applyImpulse(impulseX: number, impulseY: number, positionX: number, positionY: number): void
  • Parameters

    • impulseX: number
    • impulseY: number
    • positionX: number
    • positionY: number

    Returns void

  • applyImpulseTowardPosition(length: number, towardX: number, towardY: number, positionX: number, positionY: number): void
  • Parameters

    • length: number
    • towardX: number
    • towardY: number
    • positionX: number
    • positionY: number

    Returns void

  • applyPolarForce(angle: number, length: number, positionX: number, positionY: number): void
  • Parameters

    • angle: number
    • length: number
    • positionX: number
    • positionY: number

    Returns void

  • applyPolarImpulse(angle: number, length: number, positionX: number, positionY: number): void
  • Parameters

    • angle: number
    • length: number
    • positionX: number
    • positionY: number

    Returns void

  • applyTorque(torque: number): void
  • Parameters

    • torque: number

    Returns void

  • b2Vec2(x: number, y: number): b2Vec2
  • Parameters

    • x: number
    • y: number

    Returns b2Vec2

  • b2Vec2Sec(x: number, y: number): b2Vec2
  • Parameters

    • x: number
    • y: number

    Returns b2Vec2

  • createBody(): boolean
  • Returns boolean

  • createShape(): b2FixtureDef
  • Returns b2FixtureDef

  • enableLayer(layer: number, enable: boolean): void
  • Parameters

    • layer: number
    • enable: boolean

    Returns void

  • enableMask(mask: number, enable: boolean): void
  • Parameters

    • mask: number
    • enable: boolean

    Returns void

  • enablePrismaticJointLimits(jointId: string | number, enable: boolean): void
  • Parameters

    • jointId: string | number
    • enable: boolean

    Returns void

  • enablePrismaticJointMotor(jointId: string | number, enable: boolean): void
  • Parameters

    • jointId: string | number
    • enable: boolean

    Returns void

  • enableRevoluteJointLimits(jointId: string | number, enable: boolean): void
  • Parameters

    • jointId: string | number
    • enable: boolean

    Returns void

  • enableRevoluteJointMotor(jointId: string | number, enable: any): void
  • Parameters

    • jointId: string | number
    • enable: any

    Returns void

  • enableWheelJointMotor(jointId: string | number, enable: any): void
  • Parameters

    • jointId: string | number
    • enable: any

    Returns void

  • getAngularDamping(): number
  • Returns number

  • getAngularVelocity(): number
  • Returns number

  • getBody(): b2Body
  • Returns b2Body

  • getDensity(): number
  • Returns number

  • getDistanceJointDampingRatio(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getDistanceJointFrequency(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getDistanceJointLength(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getFriction(): number
  • Returns number

  • getFrictionJointMaxForce(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getFrictionJointMaxTorque(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getGearJointFirstJoint(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getGearJointRatio(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getGearJointSecondJoint(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getGravityScale(): number
  • Returns number

  • getGravityX(): number
  • Returns number

  • getGravityY(): number
  • Returns number

  • getInertia(): number
  • Returns number

  • getJointFirstAnchorX(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getJointFirstAnchorY(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getJointReactionForce(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getJointReactionTorque(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getJointSecondAnchorX(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getJointSecondAnchorY(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getLinearDamping(): number
  • Returns number

  • getLinearVelocityAngle(): number
  • Returns number

  • getLinearVelocityLength(): number
  • Returns number

  • getLinearVelocityX(): number
  • Returns number

  • getLinearVelocityY(): number
  • Returns number

  • getMass(): number
  • Returns number

  • getMassCenterX(): number
  • Returns number

  • getMassCenterY(): number
  • Returns number

  • getMotorJointAngularOffset(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getMotorJointCorrectionFactor(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getMotorJointMaxForce(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getMotorJointMaxTorque(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getMotorJointOffsetX(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getMotorJointOffsetY(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getMouseJointDampingRatio(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getMouseJointFrequency(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getMouseJointMaxForce(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getMouseJointTargetX(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getMouseJointTargetY(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getName(): string
  • getNameId(): number
  • Get the name identifier of the behavior.

    Returns number

    The behavior's name identifier.

  • getPolygon(verticesData: b2Vec2[]): null | Polygon
  • Parameters

    • verticesData: b2Vec2[]

    Returns null | Polygon

  • getPrismaticJointAxisAngle(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getPrismaticJointMaxMotorForce(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getPrismaticJointMaxTranslation(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getPrismaticJointMinTranslation(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getPrismaticJointMotorForce(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getPrismaticJointMotorSpeed(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getPrismaticJointReferenceAngle(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getPrismaticJointSpeed(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getPrismaticJointTranslation(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getPulleyJointFirstGroundAnchorX(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getPulleyJointFirstGroundAnchorY(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getPulleyJointFirstLength(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getPulleyJointRatio(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getPulleyJointSecondGroundAnchorX(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getPulleyJointSecondGroundAnchorY(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getPulleyJointSecondLength(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getRestitution(): number
  • Returns number

  • getRevoluteJointAngle(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getRevoluteJointMaxAngle(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getRevoluteJointMaxMotorTorque(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getRevoluteJointMinAngle(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getRevoluteJointMotorSpeed(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getRevoluteJointMotorTorque(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getRevoluteJointReferenceAngle(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getRevoluteJointSpeed(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getRopeJointMaxLength(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getShapeScale(): number
  • Returns number

  • getTimeScale(): number
  • Returns number

  • getWeldJointDampingRatio(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getWeldJointFrequency(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getWeldJointReferenceAngle(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getWheelJointAxisAngle(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getWheelJointDampingRatio(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getWheelJointFrequency(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getWheelJointMaxMotorTorque(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getWheelJointMotorSpeed(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getWheelJointMotorTorque(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getWheelJointSpeed(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • getWheelJointTranslation(jointId: string | number): number
  • Parameters

    • jointId: string | number

    Returns number

  • hasFixedRotation(): boolean
  • Returns boolean

  • isBullet(): boolean
  • Returns boolean

  • isDynamic(): boolean
  • Returns boolean

  • isJointFirstObject(jointId: string | number): boolean
  • Parameters

    • jointId: string | number

    Returns boolean

  • isJointSecondObject(jointId: string | number): boolean
  • Parameters

    • jointId: string | number

    Returns boolean

  • isKinematic(): boolean
  • Returns boolean

  • isPolygonConvex(polygon: Polygon): boolean
  • Parameters

    Returns boolean

  • isPrismaticJointLimitsEnabled(jointId: string | number): boolean
  • Parameters

    • jointId: string | number

    Returns boolean

  • isPrismaticJointMotorEnabled(jointId: string | number): boolean
  • Parameters

    • jointId: string | number

    Returns boolean

  • isRevoluteJointLimitsEnabled(jointId: string | number): boolean
  • Parameters

    • jointId: string | number

    Returns boolean

  • isRevoluteJointMotorEnabled(jointId: string | number): boolean
  • Parameters

    • jointId: string | number

    Returns boolean

  • isSleeping(): boolean
  • Returns boolean

  • isSleepingAllowed(): boolean
  • Returns boolean

  • isStatic(): boolean
  • Returns boolean

  • isWheelJointMotorEnabled(jointId: string | number): boolean
  • Parameters

    • jointId: string | number

    Returns boolean

  • layerEnabled(layer: number): boolean
  • Parameters

    • layer: number

    Returns boolean

  • maskEnabled(mask: number): boolean
  • Parameters

    • mask: number

    Returns boolean

  • onActivate(): void
  • Reimplement this method to do extra work when the behavior is activated (after it has been deactivated, see onDeActivate).

    Returns void

  • onCreated(): void
  • Reimplement this to do extra work when the behavior is created (i.e: an object using it was created), after the object is fully initialized (so you can use this.owner without risk).

    Returns 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
  • This method is called when the owner of the behavior was hot reloaded, so its position, angle, size can have been changed outside of events.

    Returns void

  • recreateShape(): void
  • Returns void

  • removeJoint(jointId: string | number): void
  • Parameters

    • jointId: string | number

    Returns void

  • setAngularDamping(angularDamping: number): void
  • Parameters

    • angularDamping: number

    Returns void

  • setAngularVelocity(angularVelocity: number): void
  • Parameters

    • angularVelocity: number

    Returns void

  • setBullet(enable: boolean): void
  • Parameters

    • enable: boolean

    Returns void

  • setDensity(density: number): void
  • Parameters

    • density: number

    Returns void

  • setDistanceJointDampingRatio(jointId: string | number, dampingRatio: number): void
  • Parameters

    • jointId: string | number
    • dampingRatio: number

    Returns void

  • setDistanceJointFrequency(jointId: string | number, frequency: number): void
  • Parameters

    • jointId: string | number
    • frequency: number

    Returns void

  • setDistanceJointLength(jointId: string | number, length: number): void
  • Parameters

    • jointId: string | number
    • length: number

    Returns void

  • setDynamic(): void
  • Returns void

  • setFixedRotation(enable: boolean): void
  • Parameters

    • enable: boolean

    Returns void

  • setFriction(friction: any): void
  • Parameters

    • friction: any

    Returns void

  • setFrictionJointMaxForce(jointId: string | number, maxForce: number): void
  • Parameters

    • jointId: string | number
    • maxForce: number

    Returns void

  • setFrictionJointMaxTorque(jointId: string | number, maxTorque: number): void
  • Parameters

    • jointId: string | number
    • maxTorque: number

    Returns void

  • setGearJointRatio(jointId: string | number, ratio: number): void
  • Parameters

    • jointId: string | number
    • ratio: number

    Returns void

  • setGravity(x: number, y: number): void
  • Parameters

    • x: number
    • y: number

    Returns void

  • setGravityScale(gravityScale: number): void
  • Parameters

    • gravityScale: number

    Returns void

  • setKinematic(): void
  • Returns void

  • setLinearDamping(linearDamping: number): void
  • Parameters

    • linearDamping: number

    Returns void

  • setLinearVelocityX(linearVelocityX: number): void
  • Parameters

    • linearVelocityX: number

    Returns void

  • setLinearVelocityY(linearVelocityY: number): void
  • Parameters

    • linearVelocityY: number

    Returns void

  • setMotorJointAngularOffset(jointId: string | number, offsetAngle: number): void
  • Parameters

    • jointId: string | number
    • offsetAngle: number

    Returns void

  • setMotorJointCorrectionFactor(jointId: string | number, correctionFactor: number): void
  • Parameters

    • jointId: string | number
    • correctionFactor: number

    Returns void

  • setMotorJointMaxForce(jointId: string | number, maxForce: number): void
  • Parameters

    • jointId: string | number
    • maxForce: number

    Returns void

  • setMotorJointMaxTorque(jointId: string | number, maxTorque: number): void
  • Parameters

    • jointId: string | number
    • maxTorque: number

    Returns void

  • setMotorJointOffset(jointId: string | number, offsetX: number, offsetY: number): void
  • Parameters

    • jointId: string | number
    • offsetX: number
    • offsetY: number

    Returns void

  • setMouseJointDampingRatio(jointId: string | number, dampingRatio: number): void
  • Parameters

    • jointId: string | number
    • dampingRatio: number

    Returns void

  • setMouseJointFrequency(jointId: string | number, frequency: number): void
  • Parameters

    • jointId: string | number
    • frequency: number

    Returns void

  • setMouseJointMaxForce(jointId: string | number, maxForce: number): void
  • Parameters

    • jointId: string | number
    • maxForce: number

    Returns void

  • setMouseJointTarget(jointId: string | number, targetX: number, targetY: number): void
  • Parameters

    • jointId: string | number
    • targetX: number
    • targetY: number

    Returns void

  • setPrismaticJointLimits(jointId: string | number, lowerTranslation: number, upperTranslation: number): void
  • Parameters

    • jointId: string | number
    • lowerTranslation: number
    • upperTranslation: number

    Returns void

  • setPrismaticJointMaxMotorForce(jointId: string | number, maxForce: any): void
  • Parameters

    • jointId: string | number
    • maxForce: any

    Returns void

  • setPrismaticJointMotorSpeed(jointId: string | number, speed: any): void
  • Parameters

    • jointId: string | number
    • speed: any

    Returns void

  • setRestitution(restitution: number): void
  • Parameters

    • restitution: number

    Returns void

  • setRevoluteJointLimits(jointId: string | number, lowerAngle: number, upperAngle: number): void
  • Parameters

    • jointId: string | number
    • lowerAngle: number
    • upperAngle: number

    Returns void

  • setRevoluteJointMaxMotorTorque(jointId: string | number, maxTorque: any): void
  • Parameters

    • jointId: string | number
    • maxTorque: any

    Returns void

  • setRevoluteJointMotorSpeed(jointId: string | number, speed: any): void
  • Parameters

    • jointId: string | number
    • speed: any

    Returns void

  • setRopeJointMaxLength(jointId: string | number, maxLength: number): void
  • Parameters

    • jointId: string | number
    • maxLength: number

    Returns void

  • setShapeScale(shapeScale: number): void
  • Parameters

    • shapeScale: number

    Returns void

  • setSleepingAllowed(enable: boolean): void
  • Parameters

    • enable: boolean

    Returns void

  • setStatic(): void
  • Returns void

  • setTimeScale(timeScale: number): void
  • Parameters

    • timeScale: number

    Returns void

  • setTimeScaleFromObject(object: any, behaviorName: any, timeScale: any): void
  • Parameters

    • object: any
    • behaviorName: any
    • timeScale: any

    Returns void

  • setWeldJointDampingRatio(jointId: string | number, dampingRatio: number): void
  • Parameters

    • jointId: string | number
    • dampingRatio: number

    Returns void

  • setWeldJointFrequency(jointId: string | number, frequency: number): void
  • Parameters

    • jointId: string | number
    • frequency: number

    Returns void

  • setWheelJointDampingRatio(jointId: string | number, dampingRatio: any): void
  • Parameters

    • jointId: string | number
    • dampingRatio: any

    Returns void

  • setWheelJointFrequency(jointId: string | number, frequency: any): void
  • Parameters

    • jointId: string | number
    • frequency: any

    Returns void

  • setWheelJointMaxMotorTorque(jointId: string | number, maxTorque: number): void
  • Parameters

    • jointId: string | number
    • maxTorque: number

    Returns void

  • setWheelJointMotorSpeed(jointId: string | number, speed: any): void
  • Parameters

    • jointId: string | number
    • speed: any

    Returns void

  • Called at each frame after events. Call doStepPostEvents.
    Behaviors writers: Please do not redefine this method. Redefine doStepPreEvents instead.

    Parameters

    Returns void

  • Called at each frame before events. Call doStepPreEvents.
    Behaviors writers: Please do not redefine this method. Redefine doStepPreEvents instead.

    Parameters

    Returns void

  • updateBodyFromObject(): void
  • Returns void

  • updateFromBehaviorData(oldBehaviorData: any, newBehaviorData: any): boolean
  • Called when the behavior must be updated using the specified behaviorData. This is the case during hot-reload, and is only called if the behavior was modified.

    Parameters

    • oldBehaviorData: any
    • newBehaviorData: any

    Returns boolean

    true if the behavior was updated, false if it could not (i.e: hot-reload is not supported).

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