artisynth.core.mfreemodels
Class MFreeCollisionData

java.lang.Object
  extended by artisynth.core.mechmodels.DeformableCollisionDataBase
      extended by artisynth.core.mfreemodels.MFreeCollisionData
All Implemented Interfaces:
CollisionData, DeformableCollisionData

public class MFreeCollisionData
extends DeformableCollisionDataBase


Constructor Summary
MFreeCollisionData(MFreeModel3d mod, PolygonalMesh mesh)
           
 
Method Summary
 int addConstraintInfo(Vertex3d vtx, Point3d constraintLoc, double weight, DeformableContactConstraint con)
          Adds the point information from this object's vertex and weight to the supplied constraint.
 void addContact(DeformableContactConstraint c)
          Add contact constraint to set of constraints
 boolean allowCollision(ContactPenetratingPoint cpp, boolean isVertex, CollisionData otherData)
          Allow a collision between this object and the supplied 'other'.
 MFreeContactConstraint createContact(Vertex3d... vtxs)
           
 MFreeModel3d getComponent()
          Returns the component involved in the collision
 int getVertexDependencies(Vertex3d vtx, java.util.ArrayList<Point> pointDeps, VectorNd pointWgts, java.util.ArrayList<Frame> frameDeps, VectorNd frameWgts)
          Determines the set of points that a vertex's position is dependent upon, along with their weights (assuming a linear relationship)
 void markMasters(Vertex3d vtx, boolean marked)
          Mark the master dynamic components of vertex vtx as being "used"
 int numActiveMasters(ContactPenetratingPoint cpp, boolean isVertex)
           
 int numActiveMasters(EdgeEdgeContact eec, boolean isFirst)
           
 int numActiveUnmarkedMasters(Vertex3d vtx)
          Count the number of "free" master components for vertex vtx.
 
Methods inherited from class artisynth.core.mechmodels.DeformableCollisionDataBase
addBilateralConstraints, addFrictionConstraints, allowCollision, clearContactActivity, clearContactData, contactsHaveChanged, getAuxState, getBilateralImpulses, getBilateralInfo, getBilateralSizes, getCollisionTol, getContact, getContact, getFriction, getInitialAuxState, getMesh, hasActiveContact, hasActiveContact, hasActiveContacts, maxFrictionConstraintSets, notifyContactsChanged, numActiveContacts, reduceConstraints, removeInactiveContacts, setAuxState, setBilateralImpulses, setFriction, setPenetrationTol, skipAuxState, updateFrictionConstraints, zeroImpulses
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MFreeCollisionData

public MFreeCollisionData(MFreeModel3d mod,
                          PolygonalMesh mesh)
Method Detail

getComponent

public MFreeModel3d getComponent()
Description copied from interface: CollisionData
Returns the component involved in the collision


createContact

public MFreeContactConstraint createContact(Vertex3d... vtxs)

addContact

public void addContact(DeformableContactConstraint c)
Description copied from interface: DeformableCollisionData
Add contact constraint to set of constraints

Specified by:
addContact in interface DeformableCollisionData
Overrides:
addContact in class DeformableCollisionDataBase

allowCollision

public boolean allowCollision(ContactPenetratingPoint cpp,
                              boolean isVertex,
                              CollisionData otherData)
Description copied from interface: DeformableCollisionData
Allow a collision between this object and the supplied 'other'. You should not allow if the objects are attached at any of the involved points.

Parameters:
cpp - the contact-penetrating point involved between the two.
isVertex - if true, checks if we can allow collision based on the vertex, otherwise if we are checking the face
otherData - the other collision object involved
Returns:
true if the collision is allowed, false otherwise

numActiveMasters

public int numActiveMasters(ContactPenetratingPoint cpp,
                            boolean isVertex)

numActiveMasters

public int numActiveMasters(EdgeEdgeContact eec,
                            boolean isFirst)

getVertexDependencies

public int getVertexDependencies(Vertex3d vtx,
                                 java.util.ArrayList<Point> pointDeps,
                                 VectorNd pointWgts,
                                 java.util.ArrayList<Frame> frameDeps,
                                 VectorNd frameWgts)
Description copied from interface: DeformableCollisionData
Determines the set of points that a vertex's position is dependent upon, along with their weights (assuming a linear relationship)

Parameters:
vtx - the vertex belonging to this collision data
pointDeps - list of points that is filled
pointWgts - weights associated with the returned points
frameDeps - list of frames that is filled
frameWgts - weights associated with the returned frames
Returns:
the number of dependent points

addConstraintInfo

public int addConstraintInfo(Vertex3d vtx,
                             Point3d constraintLoc,
                             double weight,
                             DeformableContactConstraint con)
Description copied from interface: CollisionData
Adds the point information from this object's vertex and weight to the supplied constraint.

Specified by:
addConstraintInfo in interface CollisionData
Overrides:
addConstraintInfo in class DeformableCollisionDataBase
Parameters:
vtx - vertex belonging to this object
constraintLoc - actual world location of constraint
weight - weight used in constraint
con - the constraint to modify
Returns:
the number of constraints added or modified

markMasters

public void markMasters(Vertex3d vtx,
                        boolean marked)
Description copied from interface: CollisionData
Mark the master dynamic components of vertex vtx as being "used"


numActiveUnmarkedMasters

public int numActiveUnmarkedMasters(Vertex3d vtx)
Description copied from interface: CollisionData
Count the number of "free" master components for vertex vtx. Used for determining whether or not a collision should be allowed.