Click or drag to resize
Ab4d.SharpEngine logo

BoxModelNode Class

BoxModelNode defines a SceneNode that represents a 3D box (cube).
Inheritance Hierarchy

Namespace: Ab4d.SharpEngine.SceneNodes
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 2.0.8956+4c7684e186ca1be74e7a284fbe739d9a1b843d3c
Syntax
C#
public class BoxModelNode : ModelNode

The BoxModelNode type exposes the following members.

Constructors
Properties
 NameDescription
Public propertyPosition Position of the box. By default this represents the center position of the box, but can be changed by PositionType property. Default value is (0, 0, 0). Property change will re-generate the mesh in the next update phase. To immediately re-generate the mesh, call the Update method.
Public propertyPositionType Type of the Position. Default value is Center. Property change will re-generate the mesh in the next update phase. To immediately re-generate the mesh, call the Update method.
Public propertySize Size of the box. Default value is (0, 0, 0). Property change will re-generate the mesh in the next update phase. To immediately re-generate the mesh, call the Update method.
Public propertyUseSharedBoxMesh Gets or sets a Boolean that specifies if a shared mesh with center at (0, 0, 0) and size (1, 1, 1) is used for this box (this uses the same vertex and index buffer for all boxes with shared mesh; this can be used only when XSegmentsCount, YSegmentsCount and ZSegmentsCount are 1). In this case the final position and size is set by using a mesh transformation. When false, then a new mesh instance is created that has the center and size that are specified in this box model. Default value is true.
Public propertyXSegmentsCount Number of segments in the X direction. Default value is 1. Property change will re-generate the mesh in the next update phase. To immediately re-generate the mesh, call the Update method.
Public propertyYSegmentsCount Number of segments in the Y direction. Default value is 1. Property change will re-generate the mesh in the next update phase. To immediately re-generate the mesh, call the Update method.
Public propertyZSegmentsCount Number of segments in the Z direction. Default value is 1. Property change will re-generate the mesh in the next update phase. To immediately re-generate the mesh, call the Update method.
Top
Methods
 NameDescription
Public methodGetCenterPosition Returns center position of this Box. When applyTransformation is true (by default), then center position is also transformed by Transform.
(Overrides ModelNodeGetCenterPosition(Boolean, Boolean))
Protected methodOnInitializeSceneResources Initializes resources with the specified Scene and GpuDevice. This method can be override and is called from InitializeSceneResources(Scene) method.
(Overrides ModelNodeOnInitializeSceneResources(Scene, VulkanDevice))
Protected methodUpdateLocalBoundingBox UpdateLocalBoundingBox
(Overrides ModelNodeUpdateLocalBoundingBox)
Protected methodUpdateMesh UpdateMesh method recreates the mesh based on the current object properties. The method should be overriden in the derived class that provides its own mesh generation.
(Overrides ModelNodeUpdateMesh)
Top
See Also