Class BoxBrush
Performs CSG box brush operation that adds or removes geometry.
Inherited Members
Assembly: FlaxEngine.dll
File: Engine/Level/Actors/BoxBrush.h
Syntax
public class BoxBrush : public Actor, public CSG::Brush
Fields
ScaleInLightmap
Brush surfaces scale in lightmap
Declaration
public float ScaleInLightmap = 1.0f
Field Value
float
|
Surfaces
Methods
CanUseCSG()
Returns true if brush affects world
Declaration
public virtual bool CanUseCSG() const override
Returns
bool
True if use CSG brush during level geometry building |
Overrides
Deserialize(DeserializeStream& stream, ISerializeModifier* modifier)
Deserializes object from the input stream.
Declaration
public virtual void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override
Parameters
DeserializeStream
stream
The input stream. |
ISerializeModifier
modifier
The deserialization modifier object. Always valid. |
Overrides
GetBrushID()
Gets the CSG brush object ID.
Declaration
public virtual Guid GetBrushID() const override
Returns
Guid
The unique ID. |
Overrides
GetBrushMode()
Gets CSG brush mode
Declaration
public virtual CSG::Mode GetBrushMode() const override
Returns
CSG::Mode
Mode |
Overrides
GetBrushScene()
Gets the scene.
Declaration
public virtual Scene* GetBrushScene() const override
Returns
Scene
Scene |
Overrides
GetCenter()
Gets the brush center (in local space).
Declaration
public Vector3 GetCenter() const
Returns
Vector3
The value. |
GetMode()
GetOrientedBox()
Gets the volume bounding box (oriented).
Declaration
public OrientedBoundingBox GetOrientedBox() const
Returns
OrientedBoundingBox
|
GetSize()
Gets the brush size.
Declaration
public Vector3 GetSize() const
Returns
Vector3
The value. |
GetSurfaces()
Gets the brush proxies per surface.
Declaration
public Array<BrushSurface> GetSurfaces() const
Returns
Array<BrushSurface>
|
GetSurfaces(Array<CSG::Surface>& surfaces)
Declaration
public void GetSurfaces(Array<CSG::Surface>& surfaces) override
Parameters
Array<CSG::Surface>
surfaces
|
GetSurfaces(CSG::Surface surfaces[6])
Gets CSG surfaces
Declaration
public void GetSurfaces(CSG::Surface surfaces[6])
Parameters
CSG::Surface
surfaces
Surfaces |
GetSurfacesCount()
Gets brush surfaces amount
Declaration
public virtual int32 GetSurfacesCount() override
Returns
int32
The mount of the brush surfaces. |
Overrides
GetVertices(int32 surfaceIndex, Array<Vector3>& outputData)
Gets the brush surface triangles array (group by 3 vertices).
Declaration
public void GetVertices(int32 surfaceIndex, Array<Vector3>& outputData) const
Parameters
int32
surfaceIndex
The brush surface index. |
Array<Vector3>
outputData
The output vertices buffer with triangles or empty if no data loaded. |
Intersects(int32 surfaceIndex, const Ray& ray, Real& distance, Vector3& normal)
Determines if there is an intersection between the brush surface and a ray. If collision data is available on the CPU performs exact intersection check with the geometry. Otherwise performs simple BoundingBox vs Ray test. For more efficient collisions detection and ray casting use physics.
Declaration
public bool Intersects(int32 surfaceIndex, const Ray& ray, Real& distance, Vector3& normal) const
Parameters
int32
surfaceIndex
The brush surface index. |
Ray
ray
The ray to test. |
Real
distance
When the method completes and returns true, contains the distance of the intersection (if any valid). |
Vector3
normal
When the method completes, contains the intersection surface normal vector (if any valid). |
Returns
bool
True if the actor is intersected by the ray, otherwise false. |
IntersectsItself(const Ray& ray, Real& distance, Vector3& normal)
Determines if there is an intersection between the current object and a ray.
Declaration
public virtual bool IntersectsItself(const Ray& ray, Real& distance, Vector3& normal) override
Parameters
Ray
ray
The ray to test. |
Real
distance
When the method completes, contains the distance of the intersection (if any valid). |
Vector3
normal
When the method completes, contains the intersection surface normal vector (if any valid). |
Returns
bool
True whether the two objects intersected, otherwise false. |
Overrides
OnActiveInTreeChanged()
Called when actor active in tree state gets changed.
Declaration
protected virtual void OnActiveInTreeChanged() override
Overrides
OnDebugDrawSelected()
Draws debug shapes for the selected actor and all child scripts.
Declaration
public virtual void OnDebugDrawSelected() override
Overrides
OnOrderInParentChanged()
Called when order in parent children array gets changed.
Declaration
protected virtual void OnOrderInParentChanged() override
Overrides
OnParentChanged()
Called when actor parent gets changed.
Declaration
protected virtual void OnParentChanged() override
Overrides
OnTransformChanged()
Called when actor transform gets changed.
Declaration
protected virtual void OnTransformChanged() override
Overrides
Serialize(SerializeStream& stream, const void* otherObj)
Serializes object to the output stream compared to the values of the other object instance (eg. default class object). If other object is null then serialize all properties.
Declaration
public virtual void Serialize(SerializeStream& stream, const void* otherObj) override
Parameters
SerializeStream
stream
The output stream. |
void
otherObj
The instance of the object to compare with and serialize only the modified properties. If null, then serialize all properties. |
Overrides
SetCenter(const Vector3& value)
Sets the brush center (in local space).
Declaration
public void SetCenter(const Vector3& value)
Parameters
Vector3
value
The value. |
SetMaterial(int32 surfaceIndex, MaterialBase* material)
Sets the brush surface material.
Declaration
public void SetMaterial(int32 surfaceIndex, MaterialBase* material)
Parameters
int32
surfaceIndex
The brush surface index. |
MaterialBase
material
The material. |
SetMode(BrushMode value)
Sets the CSG brush mode.
Declaration
public void SetMode(BrushMode value)
Parameters
BrushMode
value
The value. |
SetSize(const Vector3& value)
Sets the brush size.
Declaration
public void SetSize(const Vector3& value)
Parameters
Vector3
value
The value. |
SetSurfaces(const Array<BrushSurface>& value)
Sets the brush proxies per surface.
Declaration
public void SetSurfaces(const Array<BrushSurface>& value)
Parameters
Array<BrushSurface>
value
|