class-description NEWS COMMUNITY STORE TUTORIALS SIGN UP LOGIN LOGOUT ROKOJORI NEWSLETTER SIGN UP LOGIN LOGOUT NEWS COMMUNITY STORE TUTORIALS TOGGLE FULLSCREEN VOLLBILD AN/AUS ObjectNodeNode3DCollisionObject3D PhysicsBody3D
Abstract base class for 3D game objects affected by physics.

PhysicsBody3D is an abstract base class for 3D game objects affected by physics. All 3D physics bodies inherit from it.

Warning: With a non-uniform scale, this node will likely not behave as expected. It is advised to keep its scale the same on all axes and adjust its collision shape(s) instead.

bool axis_lock_angular_x<>():bool

Lock the body's rotation in the X axis.

bool axis_lock_angular_y<>():bool

Lock the body's rotation in the Y axis.

bool axis_lock_angular_z<>():bool

Lock the body's rotation in the Z axis.

bool axis_lock_linear_x<>():bool

Lock the body's linear movement in the X axis.

bool axis_lock_linear_y<>():bool

Lock the body's linear movement in the Y axis.

bool axis_lock_linear_z<>():bool

Lock the body's linear movement in the Z axis.

void add_collision_exception_with<>( Node body=, body:Node=, ):void

Adds a body to the list of bodies that this body can't collide with.

bool get_axis_lock<>( BodyAxis axis=, axis:BodyAxis=, ):bool

Returns true if the specified linear or rotational axis is locked.

PhysicsBody3D[] get_collision_exceptions<>():PhysicsBody3D[]

Returns an array of nodes that were added as collision exceptions for this body.

Vector3 get_gravity<>():Vector3

Returns the gravity vector computed from all sources that can affect the body, including all gravity overrides from Area3D nodes and the global world gravity.

KinematicCollision3D move_and_collide<>( Vector3 motion=, motion:Vector3=, bool test_only=false, test_only:bool=false, float safe_margin=0.001, safe_margin:float=0.001, bool recovery_as_collision=false, recovery_as_collision:bool=false, int max_collisions=1, max_collisions:int=1, ):KinematicCollision3D

Moves the body along the vector motion. In order to be frame rate independent in Node._physics_process or Node._process, motion should be computed using delta.

The body will stop if it collides. Returns a KinematicCollision3D, which contains information about the collision when stopped, or when touching another body along the motion.

If test_only is true, the body does not move but the would-be collision information is given.

safe_margin is the extra margin used for collision recovery (see CharacterBody3D.safe_margin for more details).

If recovery_as_collision is true, any depenetration from the recovery phase is also reported as a collision; this is used e.g. by CharacterBody3D for improving floor detection during floor snapping.

max_collisions allows to retrieve more than one collision result.

void remove_collision_exception_with<>( Node body=, body:Node=, ):void

Removes a body from the list of bodies that this body can't collide with.

void set_axis_lock<>( BodyAxis axis=, axis:BodyAxis=, bool lock=, lock:bool=, ):void

Locks or unlocks the specified linear or rotational axis depending on the value of lock.

bool test_move<>( Transform3D from=, from:Transform3D=, Vector3 motion=, motion:Vector3=, KinematicCollision3D collision=null, collision:KinematicCollision3D=null, float safe_margin=0.001, safe_margin:float=0.001, bool recovery_as_collision=false, recovery_as_collision:bool=false, int max_collisions=1, max_collisions:int=1, ):bool

Checks for collisions without moving the body. In order to be frame rate independent in Node._physics_process or Node._process, motion should be computed using delta.

Virtually sets the node's position, scale and rotation to that of the given Transform3D, then tries to move the body along the vector motion. Returns true if a collision would stop the body from moving along the whole path.

collision is an optional object of type KinematicCollision3D, which contains additional information about the collision when stopped, or when touching another body along the motion.

safe_margin is the extra margin used for collision recovery (see CharacterBody3D.safe_margin for more details).

If recovery_as_collision is true, any depenetration from the recovery phase is also reported as a collision; this is useful for checking whether the body would touch any other bodies.

max_collisions allows to retrieve more than one collision result.




All social media brands are registrated trademarks and belong to their respective owners.





CONTACT IMPRINT TERMS OF USE PRIVACY © ROKOROJI ® 2021 rokojori.com
CONTACT IMPRINT TERMS OF USE PRIVACY © ROKOROJI ® 2021 rokojori.com
We are using cookies on this site. Read more... Wir benutzen Cookies auf dieser Seite. Mehr lesen...