public class SoCollisionManager extends Inventor
SoCollisionManager
class manages collisions, i.e., it controls the position of an object in a scene, preventing it from colliding with other objects in the scene.
The collision manager references a scene, an object and a transformation. It can prevent collisions between the specified object and other objects within the scene.
It can use the actual primitives of the objects during the computation, or for faster performance, it may use their bounding boxes.
When the referenced transformation changes, the collision manager looks for a collision between the bounding box of the object and the bounding boxes of objects within the scene. If a collision between the bounding boxes is detected, the algorithm can (depending on what the programmer specifies) compute a more precise intersection using the actual primitives of the object and/or the objects of the scene.
The algorithm can call programmer-supplied callbacks when there is a collision between the bounding boxes, and when there is a collision between the primitives of the shapes.
When there is a collision, the collision manager can "glue" the object on the scene. This refers to placing the object at the position just before the first collision that would occur along the transformation path. For example, if an object would collide with (intersect) a wall, the object would be placed directly against the wall.
See also:
SoIntersectionDetectionAction
, SoWinCollisionViewer
Modifier and Type | Class and Description |
---|---|
static class |
SoCollisionManager.Axis
Axis.
|
static interface |
SoCollisionManager.BBoxCollisionListener
Bounding box collision callbacks are called after the bounding box
collision detection and before real detection, allowing the programmer to
change the
|
static class |
SoCollisionManager.CollidingPrimitive
Vertices array can contains 2 or 3 elements whether primitive is a segment
or a triangle.
|
static interface |
SoCollisionManager.CollisionListener
Collision callbacks are called when there is a collision.
|
static class |
SoCollisionManager.CompListItem |
static interface |
SoCollisionManager.Filter
Filter callback is called when an object shape collides with a scene
shape.
|
static class |
SoCollisionManager.ManagerListItem |
static class |
SoCollisionManager.PairTableItem |
static class |
SoCollisionManager.Positions
Postion.
|
static class |
SoCollisionManager.Resps
Types definitions.
|
static class |
SoCollisionManager.SceneInformationItem |
static class |
SoCollisionManager.ShapeBBoxInformationItem |
static class |
SoCollisionManager.TransformChangeTypes
Transform change type.
|
Inventor.ConstructorCommand
VERBOSE_LEVEL, ZeroHandle
Constructor and Description |
---|
SoCollisionManager(SoPath object,
SoGroup scene,
SoTransform transform)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
activate()
Calls activate(true).
|
void |
activate(boolean flag)
Sets a flag to activate the collision manager, for instance, to tell it to watch the transformation and start collision detection computations when the transformation changes.
|
void |
addBBoxCollisionListener(SoCollisionManager.BBoxCollisionListener listener)
Adds bounding box collision callback.
|
void |
addCollisionListener(SoCollisionManager.CollisionListener listener)
Adds collision callback.
|
int |
getGluingLevel()
Returns the gluing level.
|
SoPath |
getObject()
Returns the object that will be transformed.
|
SoGroup |
getScene()
Returns the scene the object is interacting with.
|
SoTransform |
getTransform()
Returns the transformation that will be watched.
|
boolean |
isActivated()
Returns a flag indicating whether the collision manager is activated.
|
boolean |
isGluing()
Returns a flag indicating whether the collision manager should place the object at the position just before the first collision that would occur along the transformation path.
|
boolean |
isObjectBBoxOnly()
Returns a flag indicating whether to use the object's bounding box instead of the actual primitives when computing collisions.
|
boolean |
isSceneBBoxOnly()
Returns a flag indicating whether to use the bounding boxes of objects in the scene instead of the actual primitives when computing collisions.
|
void |
removeBBoxCollisionListener(SoCollisionManager.BBoxCollisionListener listener)
Removes bounding box collision callback.
|
void |
removeCollisionListener(SoCollisionManager.CollisionListener listener)
Removes collision callback.
|
void |
setFilter(SoCollisionManager.Filter f)
Sets the Filter callback function called when an object shape collides with a scene
shape.
|
void |
setGluing()
Calls setGluing(true).
|
void |
setGluing(boolean flag)
Sets a flag indicating that the collision manager should place the object at the position just before the first collision that would occur along the transformation path.
|
void |
setGluingLevel(int level)
Sets the gluing level.
|
void |
setObject(SoPath object)
Sets the object that will be transformed.
|
void |
setObjectBBoxOnly()
Calls setObjectBBoxOnly(true).
|
void |
setObjectBBoxOnly(boolean flag)
Sets a flag indicating whether to use the object's bounding box instead of the actual primitives when computing collisions.
|
void |
setScene(SoGroup scene)
Sets the scene the object is interacting with.
|
void |
setSceneBBoxOnly()
Calls setSceneBBoxOnly(true).
|
void |
setSceneBBoxOnly(boolean flag)
Sets a flag indicating whether to use the bounding boxes of objects in the scene instead of the actual primitives when computing collisions.
|
void |
setTransform(SoTransform transform)
Sets the transformation that will be watched.
|
dispose, getAddress, getNativeResourceHandle, startInternalThreads, stopInternalThreads
@Deprecated public static final int NEXT_PRIMITIVE
SoCollisionManager.Resps.NEXT_PRIMITIVE
instead.@Deprecated public static final int NEXT_SHAPE
SoCollisionManager.Resps.NEXT_SHAPE
instead.@Deprecated public static final int ABORT
SoCollisionManager.Resps.ABORT
instead.@Deprecated public static final int NONE
SoCollisionManager.TransformChangeTypes.NONE
instead.@Deprecated public static final int TRANSLATION
SoCollisionManager.TransformChangeTypes.TRANSLATION
instead.@Deprecated public static final int SCALE
SoCollisionManager.TransformChangeTypes.SCALE
instead.@Deprecated public static final int ROTATION
SoCollisionManager.TransformChangeTypes.ROTATION
instead.@Deprecated public static final int ORIENTATION
SoCollisionManager.TransformChangeTypes.ORIENTATION
instead.@Deprecated public static final int CENTER
SoCollisionManager.TransformChangeTypes.CENTER
instead.@Deprecated public static final int X_AXIS
SoCollisionManager.Axis.X_AXIS
instead.@Deprecated public static final int Y_AXIS
SoCollisionManager.Axis.Y_AXIS
instead.@Deprecated public static final int Z_AXIS
SoCollisionManager.Axis.Z_AXIS
instead.@Deprecated public static final int BEGIN
SoCollisionManager.Positions.BEGIN
instead.@Deprecated public static final int END
SoCollisionManager.Positions.END
instead.public SoCollisionManager(SoPath object, SoGroup scene, SoTransform transform)
public void setFilter(SoCollisionManager.Filter f)
public void addBBoxCollisionListener(SoCollisionManager.BBoxCollisionListener listener)
public void removeBBoxCollisionListener(SoCollisionManager.BBoxCollisionListener listener)
public void addCollisionListener(SoCollisionManager.CollisionListener listener)
public void removeCollisionListener(SoCollisionManager.CollisionListener listener)
public void setSceneBBoxOnly()
public void setObjectBBoxOnly()
public void activate()
public void setGluing()
public void setScene(SoGroup scene)
public SoGroup getScene()
public void setTransform(SoTransform transform)
public void setObject(SoPath object)
public SoPath getObject()
public void setGluing(boolean flag)
public boolean isSceneBBoxOnly()
public boolean isGluing()
public boolean isActivated()
public void activate(boolean flag)
public void setSceneBBoxOnly(boolean flag)
public void setGluingLevel(int level)
public SoTransform getTransform()
public int getGluingLevel()
public boolean isObjectBBoxOnly()
public void setObjectBBoxOnly(boolean flag)
Generated on January 23, 2025, Copyright © Thermo Fisher Scientific. All rights reserved. http://www.openinventor.com