User Tools

Site Tools


tutorial:blocks

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
tutorial:blocks [2023/11/18 08:26] solidblocktutorial:blocks [2023/11/18 08:34] (current) solidblock
Line 237: Line 237:
 } }
 </code> </code>
- 
-Note that the //collision shape// of the block defaults to the outline shape if it is not specified. 
  
 {{:tutorial:voxelshape_fixed.png?200|}} {{:tutorial:voxelshape_fixed.png?200|}}
 +
 +You can also define other types of shapes for the block. The type of shapes of blocks include:
 +  * **outline shape**: the shape used as default value for most type of shapes. In the worlds, when you points to the shape, the translucent black outline is displayed according to this shape. Most times it should not be empty.
 +  * **collision shape**: the shape used to calculate collisions. When entities (including players) are moving, their collision box usually cannot intersect the collision shape of blocks. Some blocks, such as fences and walls, may have a collision shape higher than one block. Some blocks, such as flowers, have an empty collision shape. Apart from modifying ''getCollisionShape'' method, you can also call ''noCollision'' in the ''FabricBlockSettings'' when creating the block.
 +  * **raycasting shape**: the shape used to calculate raycasting (the process judging which block you are pointing to). You usually do not need to specify it.
 +  * **camera collision shape**: the shape used to calculate the position of camera in third-party view. Glass and powder snow have an empty camera collision shape.
  
 ===== Next Steps ===== ===== Next Steps =====
tutorial/blocks.txt · Last modified: 2023/11/18 08:34 by solidblock