Class BoxBrush
Performs CSG box brush operation that adds or removes geometry.
Namespace: FlaxEngine
Assembly: FlaxEngine.CSharp.dll
Syntax
[ActorContextMenu("New/Other/CSG Box Brush")]
[ActorToolbox("Other", "CSG Box Brush")]
[Unmanaged]
public class BoxBrush : Actor, ISerializable
Constructors
BoxBrush()
Properties
Center
Gets or sets the brush center (in local space).
Declaration
[EditorOrder(21)]
[EditorDisplay("CSG", null)]
[Unmanaged]
public Vector3 Center { get; set; }
Property Value
Mode
Gets or sets the CSG brush mode.
Declaration
[EditorOrder(10)]
[EditorDisplay("CSG", null)]
[Unmanaged]
public BrushMode Mode { get; set; }
Property Value
OrientedBox
Gets the volume bounding box (oriented).
Declaration
[Unmanaged]
public OrientedBoundingBox OrientedBox { get; }
Property Value
ScaleInLightmap
Brush surfaces scale in lightmap
Declaration
[EditorOrder(30)]
[EditorDisplay("CSG", "Scale In Lightmap")]
[Limit(0F, 1000F, 0.1F)]
[Unmanaged]
public float ScaleInLightmap { get; set; }
Property Value
System.
|
Size
Gets or sets the brush size.
Declaration
[EditorOrder(20)]
[EditorDisplay("CSG", null)]
[Unmanaged]
public Vector3 Size { get; set; }
Property Value
Surfaces
Gets or sets the brush proxies per surface.
Declaration
[Serialize]
[EditorOrder(100)]
[EditorDisplay("Surfaces", "__inline__")]
[Collection(CanReorderItems = false, NotNullItems = true, CanResize = true)]
[Unmanaged]
public BrushSurface[] Surfaces { get; set; }
Property Value
Methods
GetVertices(Int32, out Vector3[])
Gets the brush surface triangles array (group by 3 vertices).
Declaration
[Unmanaged]
public void GetVertices(int surfaceIndex, out Vector3[] outputData)
Parameters
System. The brush surface index. |
Vector3[]
outputData
The output vertices buffer with triangles or empty if no data loaded. |
Intersects(Int32, ref Ray, out Single, out Vector3)
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 Bounding
Declaration
[Unmanaged]
public bool Intersects(int surfaceIndex, ref Ray ray, out float distance, out Vector3 normal)
Parameters
System. The brush surface index. |
Ray
ray
The ray to test. |
System. 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
System. True if the actor is intersected by the ray, otherwise false. |
SetMaterial(Int32, MaterialBase)
Sets the brush surface material.
Declaration
[Unmanaged]
public void SetMaterial(int surfaceIndex, MaterialBase material)
Parameters
System. The brush surface index. |
Material The material. |