godot_voxel/doc/source/api/VoxelBoxMover.md
Marc Gilleron d5a69003c3 Add missing classes and run doctool (doctool has issues though)
VoxelGeneratorHeightmap.height_range is wrong in the doc.
VoxelTool lost all default values in doc.
These are likely Godot bugs...
2021-11-06 02:04:16 +00:00

3.8 KiB

VoxelBoxMover

Inherits: Reference

Description:

Utility class allowing to reproduce simple move-and-slide logic using only voxel AABBs, similar to Minecraft physics. This class may only be used with blocky voxels.

Store an instance of it within a member variable of your script, and use it within method Node._process or method Node._physics_process (it works wherever you like).

var motion = Vector3(0, 0, -10 * delta) # Move forward
motion = _box_mover.get_motion(get_translation(), motion, aabb, terrain_node)
global_translate(motion)

Methods:

Return Signature
int get_collision_mask ( ) const
Vector3 get_motion ( Vector3 pos, Vector3 motion, AABB aabb, Node terrain )
void set_collision_mask ( int mask )

Method Descriptions

Given a motion vector, returns a modified vector telling you by how much to move your character. This is similar to method KinematicBody.move_and_slide, except you have to apply the movement.

  • void set_collision_mask( int mask )

Generated on Nov 06, 2021