/// <summary>Generates a brush and returns a <see cref="Chisel.Core.CSGTreeBrush"/> struct that contains a reference to it.</summary> /// <param name="localTransformation">The transformation of the brush relative to the tree root</param> /// <param name="brushMesh">A <see cref="Chisel.Core.BrushMeshInstance"/>, which is a reference to a <see cref="Chisel.Core.BrushMesh"/>.</param> /// <param name="operation">The <see cref="Chisel.Core.CSGOperationType"/> that needs to be performed with this <see cref="Chisel.Core.CSGTreeBrush"/>.</param> /// <param name="flags"><see cref="Chisel.Core.CSGTreeBrush"/> specific flags</param> /// <returns>A new <see cref="Chisel.Core.CSGTreeBrush"/>. May be an invalid node if it failed to create it.</returns> public static CSGTreeBrush Create(Matrix4x4 localTransformation, BrushMeshInstance brushMesh = default(BrushMeshInstance), CSGOperationType operation = CSGOperationType.Additive, CSGTreeBrushFlags flags = CSGTreeBrushFlags.Default) { return(Create(0, localTransformation, brushMesh, operation, flags)); }
/// <summary>Generates a brush and returns a <see cref="Chisel.Core.CSGTreeBrush"/> struct that contains a reference to it.</summary> /// <param name="userID">A unique id to help identify this particular brush. For instance, this could be an InstanceID to a [UnityEngine.Object](https://docs.unity3d.com/ScriptReference/Object.html)</param> /// <param name="brushMesh">A <see cref="Chisel.Core.BrushMeshInstance"/>, which is a reference to a <see cref="Chisel.Core.BrushMesh"/>.</param> /// <param name="operation">The <see cref="Chisel.Core.CSGOperationType"/> that needs to be performed with this <see cref="Chisel.Core.CSGTreeBrush"/>.</param> /// <param name="flags"><see cref="Chisel.Core.CSGTreeBrush"/> specific flags</param> /// <returns>A new <see cref="Chisel.Core.CSGTreeBrush"/>. May be an invalid node if it failed to create it.</returns> public static CSGTreeBrush Create(Int32 userID = 0, BrushMeshInstance brushMesh = default(BrushMeshInstance), CSGOperationType operation = CSGOperationType.Additive, CSGTreeBrushFlags flags = CSGTreeBrushFlags.Default) { return(Create(userID, default(Matrix4x4), brushMesh, operation, flags)); }
public static BrushMesh GetBrushMesh(BrushMeshInstance instance) { return(GetBrushMesh(instance.brushMeshID)); }
/// <summary>Generates a brush and returns a <see cref="Chisel.Core.CSGTreeBrush"/> struct that contains a reference to it.</summary> /// <param name="userID">A unique id to help identify this particular brush. For instance, this could be an InstanceID to a [UnityEngine.Object](https://docs.unity3d.com/ScriptReference/Object.html)</param> /// <param name="localTransformation">The transformation of the brush relative to the tree root</param> /// <param name="brushMesh">A <see cref="Chisel.Core.BrushMeshInstance"/>, which is a reference to a <see cref="Chisel.Core.BrushMesh"/>.</param> /// <param name="operation">The <see cref="Chisel.Core.CSGOperationType"/> that needs to be performed with this <see cref="Chisel.Core.CSGTreeBrush"/>.</param> /// <param name="flags"><see cref="Chisel.Core.CSGTreeBrush"/> specific flags</param> /// <returns>A new <see cref="Chisel.Core.CSGTreeBrush"/>. May be an invalid node if it failed to create it.</returns> public static CSGTreeBrush Create(Int32 userID, Matrix4x4 localTransformation, BrushMeshInstance brushMesh = default(BrushMeshInstance), CSGOperationType operation = CSGOperationType.Additive, CSGTreeBrushFlags flags = CSGTreeBrushFlags.Default) { int brushNodeID; if (GenerateBrush(userID, out brushNodeID)) { if (localTransformation != default(Matrix4x4)) { CSGTreeNode.SetNodeLocalTransformation(brushNodeID, ref localTransformation); } if (operation != CSGOperationType.Additive) { CSGTreeNode.SetNodeOperationType(brushNodeID, operation); } if (flags != CSGTreeBrushFlags.Default) { SetBrushFlags(brushNodeID, flags); } if (brushMesh.Valid) { CSGManager.SetBrushMeshID(brushNodeID, brushMesh.brushMeshID); } } else { brushNodeID = 0; } return(new CSGTreeBrush() { brushNodeID = brushNodeID }); }
public CSGTreeBrush CreateBrush(float4x4 localTransformation, Int32 userID = 0, BrushMeshInstance brushMesh = default(BrushMeshInstance), CSGOperationType operation = CSGOperationType.Additive) { return(CSGTreeBrush.Invalid); }
/// <summary>Generates a brush and returns a <see cref="Chisel.Core.CSGTreeBrush"/> struct that contains a reference to it.</summary> /// <param name="userID">A unique id to help identify this particular brush. For instance, this could be an InstanceID to a [UnityEngine.Object](https://docs.unity3d.com/ScriptReference/Object.html)</param> /// <param name="brushMesh">A <see cref="Chisel.Core.BrushMeshInstance"/>, which is a reference to a <see cref="Chisel.Core.BrushMesh"/>.</param> /// <param name="operation">The <see cref="Chisel.Core.CSGOperationType"/> that needs to be performed with this <see cref="Chisel.Core.CSGTreeBrush"/>.</param> /// <param name="flags"><see cref="Chisel.Core.CSGTreeBrush"/> specific flags</param> /// <returns>A new <see cref="Chisel.Core.CSGTreeBrush"/>. May be an invalid node if it failed to create it.</returns> public static CSGTreeBrush Create(Int32 userID = 0, BrushMeshInstance brushMesh = default(BrushMeshInstance), CSGOperationType operation = CSGOperationType.Additive) { return(Create(userID, float4x4.identity, brushMesh, operation)); }
/// <summary>Generates a brush and returns a <see cref="Chisel.Core.CSGTreeBrush"/> struct that contains a reference to it.</summary> /// <param name="localTransformation">The transformation of the brush relative to the tree root</param> /// <param name="brushMesh">A <see cref="Chisel.Core.BrushMeshInstance"/>, which is a reference to a <see cref="Chisel.Core.BrushMesh"/>.</param> /// <param name="operation">The <see cref="Chisel.Core.CSGOperationType"/> that needs to be performed with this <see cref="Chisel.Core.CSGTreeBrush"/>.</param> /// <param name="flags"><see cref="Chisel.Core.CSGTreeBrush"/> specific flags</param> /// <returns>A new <see cref="Chisel.Core.CSGTreeBrush"/>. May be an invalid node if it failed to create it.</returns> public static CSGTreeBrush Create(Matrix4x4 localTransformation, Int32 userID = 0, BrushMeshInstance brushMesh = default(BrushMeshInstance), CSGOperationType operation = CSGOperationType.Additive) { return(Create(userID, localTransformation, brushMesh, operation)); }
public static CSGTreeBrush Create(Int32 userID, float4x4 localTransformation, BrushMeshInstance brushMesh = default(BrushMeshInstance), CSGOperationType operation = CSGOperationType.Additive) { var brushNodeID = CompactHierarchyManager.CreateBrush(brushMesh, localTransformation, operation, userID); Debug.Assert(CompactHierarchyManager.IsValidNodeID(brushNodeID)); CompactHierarchyManager.SetDirty(brushNodeID); return(CSGTreeBrush.Find(brushNodeID)); }
public CSGTreeBrush CreateBrush(Int32 userID = 0, BrushMeshInstance brushMesh = default(BrushMeshInstance), CSGOperationType operation = CSGOperationType.Additive) { return(CSGTreeBrush.Create(userID, brushMesh, operation)); }