Constructors

constructor

constructor(renderView: NodeRenderView, batchIndex: number)
Populates/constructs this batch object. Parameters
  • renderView: NodeRenderView
  • batchIndex: The object’s index within its batch. Objects are placed in order inside the batch as they get processed

Properties

transform

transform: Matrix4;
The batch object’s immediate transformation Returns: Matrix4

transformInv

transformInv: Matrix4;
The batch object’s immediate inverse transformation Returns: Matrix4

Accessors

aabb

get aabb(): Box3
Gets the axis aligned bounding box of this object.
If you want to work with object dimensions and positioning, this is the bounds to use. This is the transformed aabb, unlike NodeRenderView’s aabb which does not take any transformation into account.
Returns: Box3

accelerationStructure

get accelerationStructure(): AccelerationStructure
Gets the object’s bottom level BVH. Returns: AccelerationStructure

batchIndex

get batchIndex(): number
Gets the object’s index inside its batch. Returns: number

localOrigin

get localOrigin(): Vector3
Gets local origin of the object. i.e the render view’s aabb center. Returns: Vector3

renderView

get renderView(): NodeRenderView
Gets the start index inside the batch’s index buffer. Returns: NodeRenderView

Methods

buildAccelerationStructure

buildAccelerationStructure(bvh?: MeshBVH)
Build this object’s AccelerationStructure either from scratch, using the render view’s geometry, either by using the optional bvh argument. BVH’s can be shared between objects as long as it makes sense like for example for instances.
The speckle viewer uses the three-mesh-bvh library as the backbone for any BVH related operations.
Parameters Returns: void

transformTRS

public transformTRS(
    translation: VectorLike,
    euler?: VectorLike,
    scale?: VectorLike,
    pivot?: VectorLike
  )
Used for transforming the object by using translation, rotation, scale and rotation pivot values. Parameters
  • translation: The translation component of the transformation
  • optional euler: Rotation component as euler angles in XYZ order
  • optional scale: Scale component of the transformation
  • optional pivot: The rotation pivot
Returns: void

Typedefs

VectorLike

type VectorLike = { x: number; y: number; z?: number; w?: number };
Archtype for Vector2, Vector3 and Vector4.

InstancedBatchObject

class InstancedBatchObject extends BatchObject
Child class used for instanced objects. No additional functionality, just some additional required logic wrapped.