Physics3DManager Class

Module: cc Parent Module: cc

Physical systems manager.

Index

Properties
  • enabled boolean Gets or sets whether to enable physical systems, which are not enabled by default.
  • allowSleep boolean Gets or sets whether the physical system allows automatic sleep, which defaults to true.
  • maxSubStep number Gets or sets the maximum number of child steps per frame simulated.
  • deltaTime number Gets or sets the fixed time consumed by each simulation step.
  • useFixedTime boolean Gets or sets whether to use a fixed time step.
  • gravity Vec3 Gets or sets the gravity value of the physical world, by default (0, -10, 0)
  • defaultMaterial PhysicsMaterial | null Gets the global default physical material.
Methods
  • update A physical system simulation is performed once and will now be performed automatically once per frame.
  • raycast Detect all collision boxes and return all detected results, or null if none is detected.
  • raycastClosest Detect all collision boxes and return the detection result with the shortest ray distance.

Details

Properties

enabled

Gets or sets whether to enable physical systems, which are not enabled by default.

meta description
Type boolean
Defined in cocos2d/core/3d/physics/framework/physics-manager.ts:46
allowSleep

Gets or sets whether the physical system allows automatic sleep, which defaults to true.

meta description
Type boolean
Defined in cocos2d/core/3d/physics/framework/physics-manager.ts:60
maxSubStep

Gets or sets the maximum number of child steps per frame simulated.

meta description
Type number
Defined in cocos2d/core/3d/physics/framework/physics-manager.ts:77
deltaTime

Gets or sets the fixed time consumed by each simulation step.

meta description
Type number
Defined in cocos2d/core/3d/physics/framework/physics-manager.ts:91
useFixedTime

Gets or sets whether to use a fixed time step.

meta description
Type boolean
Defined in cocos2d/core/3d/physics/framework/physics-manager.ts:105
gravity

Gets or sets the gravity value of the physical world, by default (0, -10, 0)

meta description
Type Vec3
Defined in cocos2d/core/3d/physics/framework/physics-manager.ts:119
defaultMaterial

Gets the global default physical material. Note that builtin is null

meta description
Type PhysicsMaterial | Null
Defined in cocos2d/core/3d/physics/framework/physics-manager.ts:136

Methods

update

A physical system simulation is performed once and will now be performed automatically once per frame.

meta description
Defined in cocos2d/core/3d/physics/framework/physics-manager.ts:196
Parameters
  • deltaTime number The time difference from the last execution is currently elapsed per frame
raycast

Detect all collision boxes and return all detected results, or null if none is detected. Note that the return value is taken from the object pool, so do not save the result reference or modify the result.

meta description
Returns PhysicsRayResult[] | Null
Defined in cocos2d/core/3d/physics/framework/physics-manager.ts:223
Parameters
  • worldRay Ray A ray in world space
  • groupIndexOrName number | string Collision group index or group name
  • maxDistance number Maximum detection distance
  • queryTrigger boolean Detect trigger or not
raycastClosest

Detect all collision boxes and return the detection result with the shortest ray distance. If not, return null value. Note that the return value is taken from the object pool, so do not save the result reference or modify the result.

meta description
Returns PhysicsRayResult | Null
Defined in cocos2d/core/3d/physics/framework/physics-manager.ts:250
Parameters
  • worldRay Ray A ray in world space
  • groupIndexOrName number | string Collision group index or group name
  • maxDistance number Maximum detection distance
  • queryTrigger boolean Detect trigger or not

results matching ""

    No results matching ""