use of artisynth.core.mechmodels.Collidable in project artisynth_core by artisynth.
the class MechModel method getCollidableBodies.
/**
* Return a list of all collidable bodies located within this
* MechModel (including sub-MechModels).
*/
ArrayList<CollidableBody> getCollidableBodies() {
ArrayList<Collidable> collidables = new ArrayList<Collidable>();
getCollidables(collidables, /*level=*/
0);
ArrayList<CollidableBody> cbodies = new ArrayList<CollidableBody>();
for (Collidable c : collidables) {
if (c instanceof CollidableBody && // XXX hack until RigidBody and RigidCompositeBody are merged
!(c instanceof RigidCompositeBody)) {
cbodies.add((CollidableBody) c);
}
}
return cbodies;
}
use of artisynth.core.mechmodels.Collidable in project artisynth_core by artisynth.
the class SimpleCollide method setTopObject.
public void setTopObject(ObjectType type) {
MechModel mechMod = (MechModel) models().get(0);
if (myTopType != type) {
if (myTopObject != null) {
if (myBottomObject != null) {
mechMod.clearCollisionBehavior(myTopObject, myBottomObject);
}
removeObject(myTopObject, myTopType);
}
Collidable comp = createObject("topObject", type);
setTopObject(comp, type);
addObject(comp, type);
createAndAddControlPanel("Top object", comp);
if (myBottomObject != null) {
mechMod.setCollisionBehavior(myTopObject, myBottomObject, true, myFriction);
}
}
}
use of artisynth.core.mechmodels.Collidable in project artisynth_core by artisynth.
the class SimpleCollide method setBottomObject.
public void setBottomObject(ObjectType type) {
MechModel mechMod = (MechModel) models().get(0);
if (myBottomType != type) {
if (myBottomObject != null) {
if (myTopObject != null) {
mechMod.clearCollisionBehavior(myTopObject, myBottomObject);
}
removeObject(myBottomObject, myBottomType);
}
Collidable comp = createObject("bottomObject", type);
setBottomObject(comp, type);
addObject(comp, type);
createAndAddControlPanel("Bottom object", comp);
if (myTopObject != null) {
mechMod.setCollisionBehavior(myTopObject, myBottomObject, true, myFriction);
}
// addBreakPoint (0.33);
}
}
Aggregations