/// <summary> /// Calculates bounds of the visible content for this component. /// </summary> /// <param name="box">Bounds in world space represented as an axis aligned bounding box.</param> /// <param name="sphere">Bounds in world space represented as a sphere.</param> /// <returns>True if the bounds have non-zero volume, false otherwise.</returns> protected internal virtual bool CalculateBounds(out AABox box, out Sphere sphere) { Vector3 pos = SceneObject.Position; box = new AABox(pos, pos); sphere = new Sphere(pos, 0.0f); return(false); }
/// <summary>Initializes the struct with default values.</summary> public static VectorFieldOptions Default() { VectorFieldOptions value = new VectorFieldOptions(); value.countX = 1; value.countY = 1; value.countZ = 1; value.bounds = AABox.Default(); return(value); }
private static extern bool Internal_boxCastAny(IntPtr thisPtr, ref AABox box, ref Quaternion rotation, ref Vector3 unitDir, ulong layer, float max);
private static extern PhysicsQueryHit[] Internal_boxCastAll(IntPtr thisPtr, ref AABox box, ref Quaternion rotation, ref Vector3 unitDir, ulong layer, float max);
private static extern bool Internal_boxCast(IntPtr thisPtr, ref AABox box, ref Quaternion rotation, ref Vector3 unitDir, out PhysicsQueryHit hit, ulong layer, float max);
private static extern void Internal_resize(IntPtr thisPtr, ref AABox volume, ref Vector3I cellCount);
/// <summary> /// Resizes the light probe grid and inserts new light probes, if the new size is larger than previous size. New probes /// are inserted in a grid pattern matching the new size and density parameters. /// /// Note that shrinking the volume will not remove light probes. In order to remove probes outside of the new volume call /// clip(). /// /// Resize will not change the positions of current light probes. If you wish to reset all probes to the currently set /// grid position, call reset(). /// </summary> /// <param name="volume">Axis aligned volume to be covered by the light probes.</param> /// <param name="cellCount"> /// Number of grid cells to split the volume into. Minimum number of 1, in which case each corner of the volume is /// represented by a single probe. Higher values subdivide the volume in an uniform way. /// </param> public void Resize(AABox volume, Vector3I cellCount) { Internal_resize(mCachedPtr, ref volume, ref cellCount); }
private static extern int Internal_addBroadPhaseRegion(IntPtr thisPtr, ref AABox region);
private static extern void Internal_setBounds(IntPtr thisPtr, ref AABox bounds);
/// <summary> /// Creates new bounds. /// </summary> /// <param name="box">Axis aligned box representation of the bounds.</param> /// <param name="sphere">Sphere representation of the bounds.</param> public Bounds(AABox box, Sphere sphere) { Box = box; Sphere = sphere; }
private static extern void Internal_setcustomBounds(IntPtr thisPtr, ref AABox value);
private static extern int Internal_addBroadPhaseRegion(ref AABox region);
/// <summary> /// Adds a new physics region. Certain physics options require you to set up regions in which physics objects are allowed /// to be in, and objects outside of these regions will not be handled by physics. You do not need to set up these /// regions by default. /// </summary> public static int AddPhysicsRegion(AABox region) { return(Internal_addBroadPhaseRegion(ref region)); }
/// <summary>Returns a list of all colliders in the scene that overlap the provided box.</summary> /// <param name="box">Box to check for overlap.</param> /// <param name="rotation">Orientation of the box.</param> /// <param name="layer">Layers to consider for the query. This allows you to ignore certain groups of objects.</param> /// <returns>List of all colliders that overlap the box.</returns> public static Collider[] BoxOverlap(AABox box, Quaternion rotation, ulong layer = 18446744073709551615) { return(Internal_boxOverlap(ref box, ref rotation, layer)); }
/// <summary> /// Performs a sweep into the scene using a box and checks if it has hit anything. This can be significantly more /// efficient than other types of cast* calls. /// </summary> /// <param name="box">Box to sweep through the scene.</param> /// <param name="rotation">Orientation of the box.</param> /// <param name="unitDir">Unit direction towards which to perform the sweep.</param> /// <param name="layer">Layers to consider for the query. This allows you to ignore certain groups of objects.</param> /// <param name="max"> /// Maximum distance at which to perform the query. Hits past this distance will not be detected. /// </param> /// <returns>True if something was hit, false otherwise.</returns> public static bool BoxCastAny(AABox box, Quaternion rotation, Vector3 unitDir, ulong layer = 18446744073709551615, float max = 3.40282347E+38f) { return(Internal_boxCastAny(ref box, ref rotation, ref unitDir, layer, max)); }
private static extern Collider[] Internal_boxOverlap(IntPtr thisPtr, ref AABox box, ref Quaternion rotation, ulong layer);
private static extern bool Internal_boxOverlapAny(IntPtr thisPtr, ref AABox box, ref Quaternion rotation, ulong layer);
private static extern void Internal_getBounds(IntPtr thisPtr, out AABox __output);
/// <summary>Performs a sweep into the scene using a box and returns the closest found hit, if any.</summary> /// <param name="box">Box to sweep through the scene.</param> /// <param name="rotation">Orientation of the box.</param> /// <param name="unitDir">Unit direction towards which to perform the sweep.</param> /// <param name="hit">Information recorded about a hit. Only valid if method returns true.</param> /// <param name="layer">Layers to consider for the query. This allows you to ignore certain groups of objects.</param> /// <param name="max"> /// Maximum distance at which to perform the query. Hits past this distance will not be detected. /// </param> /// <returns>True if something was hit, false otherwise.</returns> public bool BoxCast(AABox box, Quaternion rotation, Vector3 unitDir, out PhysicsQueryHit hit, ulong layer = 18446744073709551615, float max = 3.40282347E+38f) { return(Internal_boxCast(mCachedPtr, ref box, ref rotation, ref unitDir, out hit, layer, max)); }
private static extern void Internal_getBounds(IntPtr thisPtr, out AABox box, out Sphere sphere);
/// <summary> /// Resizes the light probe grid and inserts new light probes, if the new size is larger than previous size. New probes /// are inserted in a grid pattern matching the new size and density parameters. /// /// Note that shrinking the volume will not remove light probes. In order to remove probes outside of the new volume call /// clip(). /// /// Resize will not change the positions of current light probes. If you wish to reset all probes to the currently set /// grid position, call reset(). /// </summary> /// <param name="volume">Axis aligned volume to be covered by the light probes.</param> public void Resize(AABox volume) { Vector3I cellCount = new Vector3I(1, 1, 1); Internal_resize(mCachedPtr, ref volume, ref cellCount); }
/// <summary>Checks if the provided box overlaps any other collider in the scene.</summary> /// <param name="box">Box to check for overlap.</param> /// <param name="rotation">Orientation of the box.</param> /// <param name="layer">Layers to consider for the query. This allows you to ignore certain groups of objects.</param> /// <returns>True if there is overlap with another object, false otherwise.</returns> public bool BoxOverlapAny(AABox box, Quaternion rotation, ulong layer = 18446744073709551615) { return(Internal_boxOverlapAny(mCachedPtr, ref box, ref rotation, layer)); }
private static extern void Internal_getGridVolume(IntPtr thisPtr, out AABox __output);
/// <summary> /// Adds a new physics region. Certain physics options require you to set up regions in which physics objects are allowed /// to be in, and objects outside of these regions will not be handled by physics. You do not need to set up these /// regions by default. /// </summary> public int AddPhysicsRegion(AABox region) { return(Internal_addBroadPhaseRegion(mCachedPtr, ref region)); }