Maya Dynamica plugin is moved to http://dynamica.googlecode.com

This commit is contained in:
erwin.coumans
2010-03-06 18:31:59 +00:00
parent 5bd008eff7
commit da3c174b0e
151 changed files with 5 additions and 28881 deletions

View File

@@ -197,7 +197,7 @@ IF(BUILD_EXTRAS)
SUBDIRS(Extras)
ENDIF(BUILD_EXTRAS)
OPTION(BUILD_BULLET_MAYA_DYNAMICA_PLUGIN "Set when you want to build the Bullet Maya Dynamica Plugin (requires Extras)" OFF)
#Maya Dynamica plugin is moved to http://dynamica.googlecode.com
SUBDIRS(src)

View File

@@ -4,6 +4,8 @@ Primary author and maintainer: Erwin Coumans
This ChangeLog is incomplete, for an up-to-date list of all fixed issues see http://bullet.googlecode.com
using http://tinyurl.com/yabmjjj
2010 March 6
- Dynamica Maya plugin (and COLLADA support) is moved to http://dynamica.googlecode.com
2010 February
- Bullet 2.76 release, revision 2010

View File

@@ -1,9 +1,7 @@
SUBDIRS( Serialize ConvexDecomposition GIMPACTUtils )
IF (BUILD_BULLET_MAYA_DYNAMICA_PLUGIN)
SUBDIRS(MayaPlugin)
ENDIF(BUILD_BULLET_MAYA_DYNAMICA_PLUGIN)
#Maya Dynamica plugin is moved to http://dynamica.googlecode.com
IF (USE_GLUT)
SUBDIRS (glui)
ENDIF (USE_GLUT)
ENDIF (USE_GLUT)

View File

@@ -1 +0,0 @@
+ BulletDynamica2.75 1.0

View File

@@ -1,80 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BulletMayaPlugin", "BulletMayaPlugin.vcproj", "{681412B0-F197-4A2F-9263-DEA2E8690146}"
ProjectSection(WebsiteProperties) = preProject
Debug.AspNetCompiler.Debug = "True"
Release.AspNetCompiler.Debug = "False"
EndProjectSection
ProjectSection(ProjectDependencies) = postProject
{A0958CD9-0E39-4A77-3711-9B488F508FBF} = {A0958CD9-0E39-4A77-3711-9B488F508FBF}
{7D6E339F-9C2C-31DA-FDB0-5EE50973CF2A} = {7D6E339F-9C2C-31DA-FDB0-5EE50973CF2A}
{61BD1097-CF2E-B296-DAA9-73A6FE135319} = {61BD1097-CF2E-B296-DAA9-73A6FE135319}
{B1B5F775-54A9-2437-E4AC-7E817E492142} = {B1B5F775-54A9-2437-E4AC-7E817E492142}
{6ADA430D-009C-2ED4-A787-2AC2D6FEB8CE} = {6ADA430D-009C-2ED4-A787-2AC2D6FEB8CE}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbulletcollision", "..\..\msvc\8\libbulletcollision.vcproj", "{6ADA430D-009C-2ED4-A787-2AC2D6FEB8CE}"
ProjectSection(WebsiteProperties) = preProject
Debug.AspNetCompiler.Debug = "True"
Release.AspNetCompiler.Debug = "False"
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbulletdynamics", "..\..\msvc\8\libbulletdynamics.vcproj", "{61BD1097-CF2E-B296-DAA9-73A6FE135319}"
ProjectSection(WebsiteProperties) = preProject
Debug.AspNetCompiler.Debug = "True"
Release.AspNetCompiler.Debug = "False"
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbulletmath", "..\..\msvc\8\libbulletmath.vcproj", "{7D6E339F-9C2C-31DA-FDB0-5EE50973CF2A}"
ProjectSection(WebsiteProperties) = preProject
Debug.AspNetCompiler.Debug = "True"
Release.AspNetCompiler.Debug = "False"
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libGIMPACTUtils", "..\..\msvc\8\libGIMPACTUtils.vcproj", "{B1B5F775-54A9-2437-E4AC-7E817E492142}"
ProjectSection(WebsiteProperties) = preProject
Debug.AspNetCompiler.Debug = "True"
Release.AspNetCompiler.Debug = "False"
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblibxml", "..\..\msvc\8\liblibxml.vcproj", "{A0958CD9-0E39-4A77-3711-9B488F508FBF}"
ProjectSection(WebsiteProperties) = preProject
Debug.AspNetCompiler.Debug = "True"
Release.AspNetCompiler.Debug = "False"
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
DebugDll|Win32 = DebugDll|Win32
ReleaseDll|Win32 = ReleaseDll|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{681412B0-F197-4A2F-9263-DEA2E8690146}.DebugDll|Win32.ActiveCfg = DebugDll|Win32
{681412B0-F197-4A2F-9263-DEA2E8690146}.DebugDll|Win32.Build.0 = DebugDll|Win32
{681412B0-F197-4A2F-9263-DEA2E8690146}.ReleaseDll|Win32.ActiveCfg = ReleaseDll|Win32
{681412B0-F197-4A2F-9263-DEA2E8690146}.ReleaseDll|Win32.Build.0 = ReleaseDll|Win32
{6ADA430D-009C-2ED4-A787-2AC2D6FEB8CE}.DebugDll|Win32.ActiveCfg = DebugDll|Win32
{6ADA430D-009C-2ED4-A787-2AC2D6FEB8CE}.DebugDll|Win32.Build.0 = DebugDll|Win32
{6ADA430D-009C-2ED4-A787-2AC2D6FEB8CE}.ReleaseDll|Win32.ActiveCfg = ReleaseDll|Win32
{6ADA430D-009C-2ED4-A787-2AC2D6FEB8CE}.ReleaseDll|Win32.Build.0 = ReleaseDll|Win32
{61BD1097-CF2E-B296-DAA9-73A6FE135319}.DebugDll|Win32.ActiveCfg = DebugDll|Win32
{61BD1097-CF2E-B296-DAA9-73A6FE135319}.DebugDll|Win32.Build.0 = DebugDll|Win32
{61BD1097-CF2E-B296-DAA9-73A6FE135319}.ReleaseDll|Win32.ActiveCfg = ReleaseDll|Win32
{61BD1097-CF2E-B296-DAA9-73A6FE135319}.ReleaseDll|Win32.Build.0 = ReleaseDll|Win32
{7D6E339F-9C2C-31DA-FDB0-5EE50973CF2A}.DebugDll|Win32.ActiveCfg = DebugDll|Win32
{7D6E339F-9C2C-31DA-FDB0-5EE50973CF2A}.DebugDll|Win32.Build.0 = DebugDll|Win32
{7D6E339F-9C2C-31DA-FDB0-5EE50973CF2A}.ReleaseDll|Win32.ActiveCfg = ReleaseDll|Win32
{7D6E339F-9C2C-31DA-FDB0-5EE50973CF2A}.ReleaseDll|Win32.Build.0 = ReleaseDll|Win32
{B1B5F775-54A9-2437-E4AC-7E817E492142}.DebugDll|Win32.ActiveCfg = DebugDll|Win32
{B1B5F775-54A9-2437-E4AC-7E817E492142}.DebugDll|Win32.Build.0 = DebugDll|Win32
{B1B5F775-54A9-2437-E4AC-7E817E492142}.ReleaseDll|Win32.ActiveCfg = ReleaseDll|Win32
{B1B5F775-54A9-2437-E4AC-7E817E492142}.ReleaseDll|Win32.Build.0 = ReleaseDll|Win32
{A0958CD9-0E39-4A77-3711-9B488F508FBF}.DebugDll|Win32.ActiveCfg = DebugDll|Win32
{A0958CD9-0E39-4A77-3711-9B488F508FBF}.DebugDll|Win32.Build.0 = DebugDll|Win32
{A0958CD9-0E39-4A77-3711-9B488F508FBF}.ReleaseDll|Win32.ActiveCfg = ReleaseDll|Win32
{A0958CD9-0E39-4A77-3711-9B488F508FBF}.ReleaseDll|Win32.Build.0 = ReleaseDll|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,96 +0,0 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
#PROJECT(MayaPlugin)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
IF ( UNIX AND NOT APPLE )
ADD_DEFINITIONS(-DLINUX)
ENDIF()
SET(CMAKE_CXX_WARNING_LEVEL 4)
#SET (CMAKE_VERBOSE_MAKEFILE TRUE)
FIND_PATH(MAYA_BASE_DIR include/maya/MFn.h PATH
/usr/autodesk/maya2009-x64
/usr/autodesk/maya2008-x64
/usr/autodesk/maya
"C:/Program Files/Autodesk/Maya2008"
"C:/Program Files/Autodesk/Maya2009"
"C:/Program Files/Autodesk/Maya8.5"
"C:/Program Files (x86)/Autodesk/Maya2010"
)
IF (MAYA_BASE_DIR)
message ("Maya found at location " ${MAYA_BASE_DIR})
SET(MAYA_INC_DIR ${MAYA_BASE_DIR}/include)
SET(MAYA_LIB_DIR ${MAYA_BASE_DIR}/lib)
INCLUDE_DIRECTORIES(${MAYA_INC_DIR} ${BULLET_PHYSICS_SOURCE_DIR}/src ${BULLET_PHYSICS_SOURCE_DIR}/Extras/MayaPlugin )
LINK_DIRECTORIES(${MAYA_LIB_DIR})
ADD_DEFINITIONS(-D_BOOL)
ADD_DEFINITIONS(-DREQUIRE_IOSTREAM)
SET(TARGET_H
box_shape.h bt_sphere_shape.h dSolverNode.h rigid_body_impl.h
box_shape_impl.h collision_shape.h mathUtils.h rigidBodyNode.h
bt_box_shape.h collision_shape_impl.h mayaUtils.h solver.h
bt_collision_shape.h collisionShapeNode.h mesh_shape.h solver_impl.h
bt_convex_hull_shape.h convex_hull_shape.h mesh_shape_impl.h sphere_shape.h
bt_mesh_shape.h convex_hull_shape_impl.h plane_shape.h sphere_shape_impl.h
bt_plane_shape.h dRigidBodyArrayCmd.h plane_shape_impl.h
bt_rigid_body.h dRigidBodyCmd.h rigidBodyArrayNode.h
bt_solver.h dSolverCmd.h rigid_body.h pdbIO.h
shared_ptr.h drawUtils.h
)
SET(TARGET_SRC
pluginMain.cpp bulletExport.cpp rigidBodyNode.cpp rigidBodyArrayNode.cpp collisionShapeNode.cpp
solver.cpp bt_solver.cpp dSolverNode.cpp dSolverCmd.cpp dRigidBodyCmd.cpp dRigidBodyArrayCmd.cpp
pdbIO.cpp drawUtils.cpp constraint/dHingeConstraintCmd.cpp constraint/dSliderConstraintCmd.cpp
constraint/hingeConstraintNode.cpp constraint/sixdofConstraintNode.cpp constraint/dNailConstraintCmd.cpp
constraint/dsixdofConstraintCmd.cpp constraint/nailConstraintNode.cpp constraint/sliderConstraintNode.cpp
)
ADD_LIBRARY(BulletMayaPlugin SHARED ${TARGET_H} ${TARGET_SRC})
IF (WIN32)
SET(MAYA_LIBS OpenMaya Foundation OpenMayaAnim OpenMayaFX OpenMayaUI)
IF (CMAKE_CL_64)
SET_TARGET_PROPERTIES(BulletMayaPlugin PROPERTIES LINK_FLAGS "/SUBSYSTEM:WINDOWS /MACHINE:X64")
ELSE (CMAKE_CL_64)
SET_TARGET_PROPERTIES(BulletMayaPlugin PROPERTIES LINK_FLAGS "/SUBSYSTEM:WINDOWS /MACHINE:X86")
ENDIF (CMAKE_CL_64)
SET_TARGET_PROPERTIES(BulletMayaPlugin PROPERTIES SUFFIX ".mll")
LINK_DIRECTORIES(${MAYA_LIB_DIR})
TARGET_LINK_LIBRARIES(BulletMayaPlugin BulletDynamics BulletCollision LinearMath ${MAYA_LIBS} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY})
SET(CMAKE_SHARED_LINKER_FLAGS "/export:initializePlugin /export:uninitializePlugin")
ELSE (WIN32)
SET(MAYA_LIBS OpenMayalib Foundation OpenMayaAnim OpenMayaFX OpenMayaUI)
LINK_DIRECTORIES(${MAYA_LIB_DIR})
TARGET_LINK_LIBRARIES(BulletMayaPlugin BulletDynamics BulletCollision LinearMath ${MAYA_LIBS} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY})
ENDIF(WIN32)
#OPTION(BUILD_STANDALONE "Build a standalone exporter program")
#
#IF (BUILD_STANDALONE)
# IF (WIN32)
#
# ELSE (WIN32)
# SET(MAYA_LIBS OpenMayalib Foundation OpenMayaAnim)
# ADD_EXECUTABLE(me ${TARGET_H} ${TARGET_SRC} standalone.cpp)
# LINK_DIRECTORIES(${MAYA_LIB_DIR})
# TARGET_LINK_LIBRARIES(me ${MAYA_LIBS} pthread m imf)
# ENDIF (WIN32)
#ENDIF (BUILD_STANDALONE)
ELSE()
MESSAGE("Maya not found, try adding your Maya path in Bullet/Extras/MayaPlugin/CMakeListst.txt under FIND_PATH(MAYA_BASE_DIR ...")
ENDIF()

View File

@@ -1,318 +0,0 @@
#MayaPlugin Makefile
## MAYA_LOCATION is the Maya installation directory. It should be already defined in your
# environment variables. If not, please change it to the appropriate directory
MAYA=$(MAYA_LOCATION)
## Change this if you want to change the installation directory
MAYA_PLUG_IN_PATH=/usr/maya-plugins
## Change this if you want to change the name of the final plugin
LIBRARY=mayaplugin.so
##################################
BULLET=../..
CPP = g++412
LD = ld
CPPFLAGS = -DBits64_ -m64 -DUNIX -D_BOOL -DLINUX -DFUNCPROTO -D_GNU_SOURCE -DLINUX_64 -fPIC \
-fno-strict-aliasing -DREQUIRE_IOSTREAM -Wno-deprecated -Wall \
-Wno-multichar -Wno-comment -Wno-sign-compare -funsigned-char \
-Wno-reorder -fno-gnu-keywords -ftemplate-depth-25 -pthread \
-Wno-deprecated -fno-gnu-keywords \
-g
LDFLAGS =-Wl,-Bsymbolic -shared
BULLET_INCLUDE=-I$(BULLET)/src
#instead of BULLET_LIB we just include all source files directly
#BULLET_LIB=-L$(BULLET)/out/linux/optimize/libs -L$(BULLET)/src \
# -lBulletColladaConverter -lcolladadom -llibxml -lGIMPACTUtils -lbulletdynamics \
# -lbulletcollision -lbulletmath
GL_LIB=-lGL -lGLU
MAYA_INCLUDE=-I$(MAYA)/include
MAYA_LIB=-L$(MAYA)/lib -lOpenMaya -lFoundation -lOpenMayaUI -lOpenMayaFX
SOURCES = pluginMain.cpp bulletExport.cpp rigidBodyNode.cpp rigidBodyArrayNode.cpp collisionShapeNode.cpp \
solver.cpp bt_solver.cpp dSolverNode.cpp dSolverCmd.cpp dRigidBodyCmd.cpp dRigidBodyArrayCmd.cpp \
pdbIO.cpp drawUtils.cpp constraint/dHingeConstraintCmd.cpp constraint/dSliderConstraintCmd.cpp \
constraint/hingeConstraintNode.cpp constraint/sixdofConstraintNode.cpp constraint/dNailConstraintCmd.cpp \
constraint/dsixdofConstraintCmd.cpp constraint/nailConstraintNode.cpp constraint/sliderConstraintNode.cpp \
$(BULLET)/src/LinearMath/btQuickprof.cpp \
$(BULLET)/src/LinearMath/btGeometryUtil.cpp \
$(BULLET)/src/LinearMath/btAlignedAllocator.cpp \
$(BULLET)/src/LinearMath/btSerializer.cpp \
$(BULLET)/src/LinearMath/btConvexHull.cpp \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btConvexCast.cpp \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/btCollisionObject.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/btGhostObject.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/btManifoldResult.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/btUnionFind.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btTetrahedronShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btShapeHull.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btMinkowskiSumShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btCompoundShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btConeShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btMultiSphereShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btUniformScalingShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btSphereShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btTriangleIndexVertexArray.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btTriangleMeshShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btTriangleBuffer.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btStaticPlaneShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btEmptyShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btCollisionShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btConvexShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btConvex2dShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btConvexInternalShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btConvexHullShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btTriangleCallback.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btCapsuleShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btConvexTriangleMeshShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btConcaveShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btConvexPointCloudShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btBoxShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btBox2dShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btOptimizedBvh.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btCylinderShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btStridingMeshInterface.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btTriangleMesh.cpp \
$(BULLET)/src/BulletCollision/BroadphaseCollision/btAxisSweep3.cpp \
$(BULLET)/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp \
$(BULLET)/src/BulletCollision/BroadphaseCollision/btDbvtBroadphase.cpp \
$(BULLET)/src/BulletCollision/BroadphaseCollision/btMultiSapBroadphase.cpp \
$(BULLET)/src/BulletCollision/BroadphaseCollision/btDispatcher.cpp \
$(BULLET)/src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.cpp \
$(BULLET)/src/BulletCollision/BroadphaseCollision/btQuantizedBvh.cpp \
$(BULLET)/src/BulletCollision/BroadphaseCollision/btCollisionAlgorithm.cpp \
$(BULLET)/src/BulletCollision/BroadphaseCollision/btDbvt.cpp \
$(BULLET)/src/BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp \
$(BULLET)/src/BulletCollision/Gimpact/btGImpactBvh.cpp \
$(BULLET)/src/BulletCollision/Gimpact/btGImpactQuantizedBvh.cpp \
$(BULLET)/src/BulletCollision/Gimpact/btTriangleShapeEx.cpp \
$(BULLET)/src/BulletCollision/Gimpact/btGImpactCollisionAlgorithm.cpp \
$(BULLET)/src/BulletCollision/Gimpact/btGImpactShape.cpp \
$(BULLET)/src/BulletCollision/Gimpact/gim_box_set.cpp \
$(BULLET)/src/BulletCollision/Gimpact/gim_contact.cpp \
$(BULLET)/src/BulletCollision/Gimpact/gim_memory.cpp \
$(BULLET)/src/BulletCollision/Gimpact/gim_tri_collision.cpp \
$(BULLET)/src/BulletDynamics/Dynamics/btContinuousDynamicsWorld.cpp \
$(BULLET)/src/BulletDynamics/Dynamics/btRigidBody.cpp \
$(BULLET)/src/BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp \
$(BULLET)/src/BulletDynamics/Dynamics/Bullet-C-API.cpp \
$(BULLET)/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.cpp \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.cpp \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btTypedConstraint.cpp \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btContactConstraint.cpp \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btSliderConstraint.cpp \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btHingeConstraint.cpp \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btHinge2Constraint.cpp \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btUniversalConstraint.cpp \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp \
$(BULLET)/src/BulletDynamics/Vehicle/btWheelInfo.cpp \
$(BULLET)/src/BulletDynamics/Vehicle/btRaycastVehicle.cpp \
$(BULLET)/src/BulletDynamics/Character/btKinematicCharacterController.cpp
HEADERS = box_shape.h bt_sphere_shape.h dSolverNode.h rigid_body_impl.h \
box_shape_impl.h collision_shape.h mathUtils.h rigidBodyNode.h \
bt_box_shape.h collision_shape_impl.h mayaUtils.h solver.h \
bt_collision_shape.h collisionShapeNode.h mesh_shape.h solver_impl.h \
bt_convex_hull_shape.h convex_hull_shape.h mesh_shape_impl.h sphere_shape.h \
bt_mesh_shape.h convex_hull_shape_impl.h plane_shape.h sphere_shape_impl.h \
bt_plane_shape.h dRigidBodyArrayCmd.h plane_shape_impl.h \
bt_rigid_body.h dRigidBodyCmd.h rigidBodyArrayNode.h \
bt_solver.h dSolverCmd.h rigid_body.h pdbIO.h \
shared_ptr.h drawUtils.h \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btConvexCast.h \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btGjkEpa2.h \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btPointCollector.h \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.h \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.h \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.h \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btGjkConvexCast.h \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btManifoldPoint.h \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btCollisionObject.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btGhostObject.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btCollisionCreateFunc.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btBoxBoxDetector.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/SphereTriangleDetector.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btUnionFind.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btCollisionWorld.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btInternalEdgeUtility.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btManifoldResult.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btCollisionConfiguration.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btConvexShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btConvex2dShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btTriangleCallback.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btCompoundShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btBoxShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btBox2dShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btMultiSphereShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btCollisionMargin.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btConcaveShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btEmptyShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btUniformScalingShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btMaterial.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btSphereShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btConvexPointCloudShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btCapsuleShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btCollisionShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btStaticPlaneShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btTriangleMeshShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btStridingMeshInterface.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btTriangleMesh.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btTriangleBuffer.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btShapeHull.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btMinkowskiSumShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btOptimizedBvh.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btTriangleShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btCylinderShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btTetrahedronShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btConvexInternalShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btConeShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btConvexHullShape.h \
$(BULLET)/src/BulletCollision/BroadphaseCollision/btAxisSweep3.h \
$(BULLET)/src/BulletCollision/BroadphaseCollision/btDbvtBroadphase.h \
$(BULLET)/src/BulletCollision/BroadphaseCollision/btSimpleBroadphase.h \
$(BULLET)/src/BulletCollision/BroadphaseCollision/btMultiSapBroadphase.h \
$(BULLET)/src/BulletCollision/BroadphaseCollision/btDbvt.h \
$(BULLET)/src/BulletCollision/BroadphaseCollision/btOverlappingPairCallback.h \
$(BULLET)/src/BulletCollision/BroadphaseCollision/btDispatcher.h \
$(BULLET)/src/BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h \
$(BULLET)/src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \
$(BULLET)/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.h \
$(BULLET)/src/BulletCollision/BroadphaseCollision/btBroadphaseInterface.h \
$(BULLET)/src/BulletCollision/BroadphaseCollision/btQuantizedBvh.h \
$(BULLET)/src/BulletDynamics/Character/btKinematicCharacterController.h \
$(BULLET)/src/BulletDynamics/Character/btCharacterControllerInterface.h \
$(BULLET)/src/BulletDynamics/Dynamics/btActionInterface.h \
$(BULLET)/src/BulletDynamics/Dynamics/btContinuousDynamicsWorld.h \
$(BULLET)/src/BulletDynamics/Dynamics/btSimpleDynamicsWorld.h \
$(BULLET)/src/BulletDynamics/Dynamics/btRigidBody.h \
$(BULLET)/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h \
$(BULLET)/src/BulletDynamics/Dynamics/btDynamicsWorld.h \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btSolverBody.h \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btConstraintSolver.h \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.h \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btTypedConstraint.h \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btContactSolverInfo.h \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btContactConstraint.h \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btJacobianEntry.h \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btSolverConstraint.h \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.h \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btSliderConstraint.h \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btHingeConstraint.h \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btHinge2Constraint.h \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btUniversalConstraint.h \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.h \
$(BULLET)/src/BulletDynamics/Vehicle/btVehicleRaycaster.h \
$(BULLET)/src/BulletDynamics/Vehicle/btRaycastVehicle.h \
$(BULLET)/src/BulletDynamics/Vehicle/btWheelInfo.h
INCLUDE_FLAGS= $(GL_INCLUDE) $(BULLET_INCLUDE) $(MAYA_INCLUDE)
#LIB_FLAGS=$(BULLET_LIB) $(MAYA_LIB) $(GL_LIB)
LIB_FLAGS= $(MAYA_LIB) $(GL_LIB)
OBJECTS=$(SOURCES:.cpp=.o)
all: $(SOURCES) $(LIBRARY)
.cpp.o: $(SOURCES) $(HEADERS)
$(CPP) -c $< $(CPPFLAGS) $(INCLUDE_FLAGS) -o $@
$(OBJECTS): $(HEADERS)
$(LIBRARY): $(OBJECTS)
$(CPP) $(OBJECTS) $(LDFLAGS) $(LIB_FLAGS) -o $@
install: $(LIBRARY)
cp -f $(LIBRARY) $(MAYA_PLUG_IN_PATH)
cp -f scripts/*.mel $(MAYA_PLUG_IN_PATH)
cp -f icons/*.xpm $(MAYA_PLUG_IN_PATH)
clean:
rm -f *.o *.so

View File

@@ -1,312 +0,0 @@
#MayaPlugin Makefile
MAYA_LOCATION?=/Applications/Autodesk/maya2010/devkit
## MAYA_LOCATION is the Maya installation directory. It should be already defined in your
# environment variables. If not, please change it to the appropriate directory
MAYA=$(MAYA_LOCATION)
## Change this if you want to change the installation directory
MAYA_PLUG_IN_PATH=/usr/maya-plugins
## Change this if you want to change the name of the final plugin
LIBRARY=dynamicaMayaPlugin.bundle
##################################
BULLET=../..
CPP = g++
LD = ld
CPPFLAGS = -DMAC_PLUGIN -DOSMac_MachO_ -DBits32_ -m32 -DUNIX -D_BOOL -DOSMac_ -DFUNCPROTO -D_GNU_SOURCE -fPIC \
-fno-strict-aliasing -DREQUIRE_IOSTREAM -Wno-deprecated -Wall \
-Wno-multichar -Wno-comment -Wno-sign-compare -funsigned-char \
-Wno-reorder -fno-gnu-keywords -ftemplate-depth-25 -pthread \
-Wno-deprecated -fno-gnu-keywords -g
#LDFLAGS =-bundle -ldl -shared
LDFLAGS = -ldl -shared
BULLET_INCLUDE=-I$(BULLET)/src -I.
GL_LIB=-framework OpenGL
MAYA_INCLUDE=-I$(MAYA)/include
MAYA_LIB=-L/Applications/Autodesk/maya2010/Maya.app/Contents/MacOS -lOpenMaya -lFoundation -Wl,-executable_path,/Applications/Autodesk/maya2010/Maya.app/Contents/MacOS -lOpenMayaUI -lOpenMayaFX -lOpenMaya -lFoundation
SOURCES = pluginMain.cpp bulletExport.cpp rigidBodyNode.cpp rigidBodyArrayNode.cpp collisionShapeNode.cpp \
solver.cpp bt_solver.cpp dSolverNode.cpp dSolverCmd.cpp dRigidBodyCmd.cpp dRigidBodyArrayCmd.cpp \
pdbIO.cpp drawUtils.cpp constraint/dHingeConstraintCmd.cpp constraint/dSliderConstraintCmd.cpp \
constraint/hingeConstraintNode.cpp constraint/sixdofConstraintNode.cpp constraint/dNailConstraintCmd.cpp \
constraint/dsixdofConstraintCmd.cpp constraint/nailConstraintNode.cpp constraint/sliderConstraintNode.cpp \
$(BULLET)/src/LinearMath/btQuickprof.cpp \
$(BULLET)/src/LinearMath/btGeometryUtil.cpp \
$(BULLET)/src/LinearMath/btAlignedAllocator.cpp \
$(BULLET)/src/LinearMath/btSerializer.cpp \
$(BULLET)/src/LinearMath/btConvexHull.cpp \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btConvexCast.cpp \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/btCollisionObject.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/btGhostObject.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/btManifoldResult.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/btUnionFind.cpp \
$(BULLET)/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btTetrahedronShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btShapeHull.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btMinkowskiSumShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btCompoundShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btConeShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btMultiSphereShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btUniformScalingShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btSphereShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btTriangleIndexVertexArray.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btTriangleMeshShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btTriangleBuffer.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btStaticPlaneShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btEmptyShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btCollisionShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btConvexShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btConvex2dShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btConvexInternalShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btConvexHullShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btTriangleCallback.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btCapsuleShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btConvexTriangleMeshShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btConcaveShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btConvexPointCloudShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btBoxShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btBox2dShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btOptimizedBvh.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btCylinderShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btStridingMeshInterface.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.cpp \
$(BULLET)/src/BulletCollision/CollisionShapes/btTriangleMesh.cpp \
$(BULLET)/src/BulletCollision/BroadphaseCollision/btAxisSweep3.cpp \
$(BULLET)/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp \
$(BULLET)/src/BulletCollision/BroadphaseCollision/btDbvtBroadphase.cpp \
$(BULLET)/src/BulletCollision/BroadphaseCollision/btMultiSapBroadphase.cpp \
$(BULLET)/src/BulletCollision/BroadphaseCollision/btDispatcher.cpp \
$(BULLET)/src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.cpp \
$(BULLET)/src/BulletCollision/BroadphaseCollision/btQuantizedBvh.cpp \
$(BULLET)/src/BulletCollision/BroadphaseCollision/btCollisionAlgorithm.cpp \
$(BULLET)/src/BulletCollision/BroadphaseCollision/btDbvt.cpp \
$(BULLET)/src/BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp \
$(BULLET)/src/BulletCollision/Gimpact/btGImpactBvh.cpp \
$(BULLET)/src/BulletCollision/Gimpact/btGImpactQuantizedBvh.cpp \
$(BULLET)/src/BulletCollision/Gimpact/btTriangleShapeEx.cpp \
$(BULLET)/src/BulletCollision/Gimpact/btGImpactCollisionAlgorithm.cpp \
$(BULLET)/src/BulletCollision/Gimpact/btGImpactShape.cpp \
$(BULLET)/src/BulletCollision/Gimpact/gim_box_set.cpp \
$(BULLET)/src/BulletCollision/Gimpact/gim_contact.cpp \
$(BULLET)/src/BulletCollision/Gimpact/gim_memory.cpp \
$(BULLET)/src/BulletCollision/Gimpact/gim_tri_collision.cpp \
$(BULLET)/src/BulletDynamics/Dynamics/btContinuousDynamicsWorld.cpp \
$(BULLET)/src/BulletDynamics/Dynamics/btRigidBody.cpp \
$(BULLET)/src/BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp \
$(BULLET)/src/BulletDynamics/Dynamics/Bullet-C-API.cpp \
$(BULLET)/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.cpp \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.cpp \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btTypedConstraint.cpp \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btContactConstraint.cpp \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btSliderConstraint.cpp \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btHingeConstraint.cpp \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btHinge2Constraint.cpp \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btUniversalConstraint.cpp \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp \
$(BULLET)/src/BulletDynamics/Vehicle/btWheelInfo.cpp \
$(BULLET)/src/BulletDynamics/Vehicle/btRaycastVehicle.cpp \
$(BULLET)/src/BulletDynamics/Character/btKinematicCharacterController.cpp
HEADERS = box_shape.h bt_sphere_shape.h dSolverNode.h rigid_body_impl.h \
box_shape_impl.h collision_shape.h mathUtils.h rigidBodyNode.h \
bt_box_shape.h collision_shape_impl.h mayaUtils.h solver.h \
bt_collision_shape.h collisionShapeNode.h mesh_shape.h solver_impl.h \
bt_convex_hull_shape.h convex_hull_shape.h mesh_shape_impl.h sphere_shape.h \
bt_mesh_shape.h convex_hull_shape_impl.h plane_shape.h sphere_shape_impl.h \
bt_plane_shape.h dRigidBodyArrayCmd.h plane_shape_impl.h \
bt_rigid_body.h dRigidBodyCmd.h rigidBodyArrayNode.h \
bt_solver.h dSolverCmd.h rigid_body.h pdbIO.h \
shared_ptr.h drawUtils.h \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btConvexCast.h \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btGjkEpa2.h \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btPointCollector.h \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.h \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.h \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.h \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btGjkConvexCast.h \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btManifoldPoint.h \
$(BULLET)/src/BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btCollisionObject.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btGhostObject.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btCollisionCreateFunc.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btBoxBoxDetector.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/SphereTriangleDetector.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btUnionFind.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btCollisionWorld.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btInternalEdgeUtility.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btManifoldResult.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.h \
$(BULLET)/src/BulletCollision/CollisionDispatch/btCollisionConfiguration.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btConvexShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btConvex2dShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btTriangleCallback.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btCompoundShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btBoxShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btBox2dShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btMultiSphereShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btCollisionMargin.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btConcaveShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btEmptyShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btUniformScalingShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btMaterial.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btSphereShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btConvexPointCloudShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btCapsuleShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btCollisionShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btStaticPlaneShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btTriangleMeshShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btStridingMeshInterface.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btTriangleMesh.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btTriangleBuffer.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btShapeHull.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btMinkowskiSumShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btOptimizedBvh.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btTriangleShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btCylinderShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btTetrahedronShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btConvexInternalShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btConeShape.h \
$(BULLET)/src/BulletCollision/CollisionShapes/btConvexHullShape.h \
$(BULLET)/src/BulletCollision/BroadphaseCollision/btAxisSweep3.h \
$(BULLET)/src/BulletCollision/BroadphaseCollision/btDbvtBroadphase.h \
$(BULLET)/src/BulletCollision/BroadphaseCollision/btSimpleBroadphase.h \
$(BULLET)/src/BulletCollision/BroadphaseCollision/btMultiSapBroadphase.h \
$(BULLET)/src/BulletCollision/BroadphaseCollision/btDbvt.h \
$(BULLET)/src/BulletCollision/BroadphaseCollision/btOverlappingPairCallback.h \
$(BULLET)/src/BulletCollision/BroadphaseCollision/btDispatcher.h \
$(BULLET)/src/BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h \
$(BULLET)/src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \
$(BULLET)/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.h \
$(BULLET)/src/BulletCollision/BroadphaseCollision/btBroadphaseInterface.h \
$(BULLET)/src/BulletCollision/BroadphaseCollision/btQuantizedBvh.h \
$(BULLET)/src/BulletDynamics/Character/btKinematicCharacterController.h \
$(BULLET)/src/BulletDynamics/Character/btCharacterControllerInterface.h \
$(BULLET)/src/BulletDynamics/Dynamics/btActionInterface.h \
$(BULLET)/src/BulletDynamics/Dynamics/btContinuousDynamicsWorld.h \
$(BULLET)/src/BulletDynamics/Dynamics/btSimpleDynamicsWorld.h \
$(BULLET)/src/BulletDynamics/Dynamics/btRigidBody.h \
$(BULLET)/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h \
$(BULLET)/src/BulletDynamics/Dynamics/btDynamicsWorld.h \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btSolverBody.h \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btConstraintSolver.h \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.h \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btTypedConstraint.h \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btContactSolverInfo.h \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btContactConstraint.h \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btJacobianEntry.h \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btSolverConstraint.h \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.h \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btSliderConstraint.h \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btHingeConstraint.h \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btHinge2Constraint.h \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btUniversalConstraint.h \
$(BULLET)/src/BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.h \
$(BULLET)/src/BulletDynamics/Vehicle/btVehicleRaycaster.h \
$(BULLET)/src/BulletDynamics/Vehicle/btRaycastVehicle.h \
$(BULLET)/src/BulletDynamics/Vehicle/btWheelInfo.h
INCLUDE_FLAGS= $(GL_INCLUDE) $(BULLET_INCLUDE) $(MAYA_INCLUDE)
LIB_FLAGS= $(MAYA_LIB) $(GL_LIB)
OBJECTS=$(SOURCES:.cpp=.o)
all: $(SOURCES) $(LIBRARY)
.cpp.o: $(SOURCES) $(HEADERS)
$(CPP) -c $< $(CPPFLAGS) $(INCLUDE_FLAGS) -o $@
$(OBJECTS): $(HEADERS)
$(LIBRARY): $(OBJECTS)
$(CPP) $(OBJECTS) $(LDFLAGS) $(LIB_FLAGS) -o $@
install: $(LIBRARY)
cp -f $(LIBRARY) /Users/Shared/Autodesk/maya/plug-ins
cp -f scripts/*.mel /Users/Shared/Autodesk/maya/scripts
cp -f icons/*.xpm /Users/Shared/Autodesk/maya/icons
clean:
rm -f *.o *.bundle

View File

@@ -1,23 +0,0 @@
Bullet Maya Plugin
How to build in linux:
Please check the beginning of the Makefile to make sure that the variables are correct.
Then do:
make install
-------------------------
How to build under Windows, using Microsoft Visual Studio 2005 or later:
Open BulletMayaPlugin.sln and select Debug or Release configuration and compile.
Maya 2008 is assumed at the default location C:\Program Files\Autodesk\Maya2008\include
Otherwise change the include path in the project settings.
Installation:
copy the folder 'icons', 'mvl' and 'scripts' into C:\Program Files\Autodesk\Maya2008

View File

@@ -1,44 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Walt Disney Studios
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Nicola Candussi <nicola@fluidinteractive.com>
*/
//box_shape.h
#ifndef DYN_BOX_SHAPE_H
#define DYN_BOX_SHAPE_H
#include "collision_shape.h"
#include "box_shape_impl.h"
class box_shape_t: public collision_shape_t
{
public:
//typedefs
typedef shared_ptr<box_shape_t> pointer;
protected:
friend class solver_t;
box_shape_t(collision_shape_impl_t* impl): collision_shape_t(impl) { }
};
#endif

View File

@@ -1,39 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Walt Disney Studios
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Nicola Candussi <nicola@fluidinteractive.com>
*/
//box_shape_impl.h
#ifndef DYN_BOX_SHAPE_IMPL_H
#define DYN_BOX_SHAPE_IMPL_H
#include "collision_shape_impl.h"
class box_shape_impl_t: public collision_shape_impl_t
{
public:
//typedefs
private:
};
#endif

View File

@@ -1,96 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Walt Disney Studios
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Nicola Candussi <nicola@fluidinteractive.com>
*/
//bt_box_shape.h
#ifndef DYN_BT_BOX_SHAPE_H
#define DYN_BT_BOX_SHAPE_H
#include "box_shape_impl.h"
#include "drawUtils.h"
class bt_box_shape_t: public bt_collision_shape_t, public box_shape_impl_t
{
public:
virtual void gl_draw(size_t draw_style)
{
// std::cout << "bt_box_shape_t::draw" << std::endl;
btBoxShape *box_shape = static_cast<btBoxShape*>(shape());
btVector3 const& e = box_shape->getHalfExtentsWithoutMargin();
glPushMatrix();
glScalef(2 * e.x(), 2 * e.y(), 2 * e.z());
if(draw_style & collision_shape_t::kDSSolid) {
solid_cube();
} else {
wire_cube();
}
glPopMatrix();
}
virtual void set_scale(vec3f const& s) {
const btVector3& scale = shape()->getLocalScaling();
if(scale.x() != s[0] || scale.y() != s[1] || scale.z() != s[2]) {
shape()->setLocalScaling(btVector3(s[0], s[1], s[2]));
update();
}
}
virtual void get_scale(vec3f& s) {
const btVector3& scale = shape()->getLocalScaling();
s = vec3f(scale.x(), scale.y(), scale.z());
}
virtual float volume() { return m_volume; }
virtual vec3f const& local_inertia() { return m_local_inertia; }
virtual vec3f const& center() { return m_center; }
virtual quatf const& rotation() { return m_rotation; }
protected:
friend class bt_solver_t;
bt_box_shape_t(vec3f const& halfExtents):
bt_collision_shape_t()
{
set_shape(new btBoxShape(btVector3(halfExtents[0], halfExtents[0], halfExtents[0])));
update();
}
void update()
{
btBoxShape *box_shape = static_cast<btBoxShape*>(shape());
btVector3 e = 2 * box_shape->getHalfExtentsWithoutMargin();
m_volume = e.x() * e.y() * e.z();
m_center = vec3f(0, 0, 0);
m_rotation = qidentity<float>();
m_local_inertia = vec3f((e.y() * e.y() + e.z() * e.z()) / 12.0f,
(e.x() * e.x() + e.z() * e.z()) / 12.0f,
(e.x() * e.x() + e.y() * e.y()) / 12.0f);
}
private:
float m_volume;
vec3f m_center;
quatf m_rotation;
vec3f m_local_inertia;
};
#endif

View File

@@ -1,51 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Walt Disney Studios
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Nicola Candussi <nicola@fluidinteractive.com>
*/
//bt_collision_shape.h
#ifndef DYN_BT_COLLISION_SHAPE_H
#define DYN_BT_COLLISION_SHAPE_H
#include "btBulletCollisionCommon.h"
#include "btBulletDynamicsCommon.h"
class bt_collision_shape_t
{
public:
protected:
friend class bt_solver_t;
bt_collision_shape_t() { }
btCollisionShape* shape() { return m_shape.get(); }
void set_shape(btCollisionShape *shape) { return m_shape.reset(shape); }
public:
friend class bt_rigid_body_t;
virtual ~bt_collision_shape_t() { }
private:
shared_ptr<btCollisionShape> m_shape;
};
#endif

View File

@@ -1,195 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Walt Disney Studios
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Nicola Candussi <nicola@fluidinteractive.com>
*/
//bt_convex_hull_shape.h
#ifndef DYN_BT_CONVEX_HULL_SHAPE_H
#define DYN_BT_CONVEX_HULL_SHAPE_H
#include <vector>
#include "convex_hull_shape_impl.h"
#include "bt_collision_shape.h"
class bt_convex_hull_shape_t: public bt_collision_shape_t, public convex_hull_shape_impl_t
{
public:
virtual void gl_draw(size_t draw_style) {
if(m_vertices.empty() || m_indices.empty()) return;
glPushMatrix();
glTranslatef(m_center[0], m_center[1], m_center[2]);
float angle;
vec3f axis;
q_to_axis_angle(m_rotation, axis, angle);
glRotatef(rad2deg(angle), axis[0], axis[1], axis[2]);
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_NORMAL_ARRAY);
if(draw_style & collision_shape_t::kDSSolid) {
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
} else {
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
}
glVertexPointer(3, GL_FLOAT, 0, &(m_vertices[0]));
glNormalPointer(GL_FLOAT, 0, &(m_normals[0]));
glDrawElements(GL_TRIANGLES, m_indices.size(), GL_UNSIGNED_INT, &(m_indices[0]));
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_NORMAL_ARRAY);
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
glPopMatrix();
}
virtual void set_scale(vec3f const& s1) {
// shape()->setLocalScaling(btVector3(s[0], s[1], s[2]));
btVector3 s(s1[0],s1[1],s1[2]);
float delSq = 0.f;
for(int i = 0; i < 3; i++)
{
float del = s[i] - m_cachedScaling[i];
delSq += del * del;
}
if (delSq > FLT_EPSILON)
{
// btAssert(shape()->getType()==
btCompoundShape* compound =(btCompoundShape*)shape();
btConvexHullShape* child = (btConvexHullShape*)compound->getChildShape(0);
/*
btTransform scaleTransf;
scaleTransf.setIdentity();
scaleTransf.getBasis()[0][0] = (s/m_cachedScaling)[0];
scaleTransf.getBasis()[1][1] = (s/m_cachedScaling)[1];
scaleTransf.getBasis()[2][2] = (s/m_cachedScaling)[2];
btTransform combinedTr = tr.inverse() * (scaleTransf * (tr * vtx));
*/
const btTransform& tr = compound->getChildTransform(0);
for (int i=0;i<child->getNumPoints();i++)
{
btVector3 oldPoint = child->getUnscaledPoints()[i];
btVector3 parentPoint = tr*oldPoint;
btVector3 parentPointScaled = parentPoint*(s/m_cachedScaling);
btVector3 childPoint = tr.inverse()*parentPointScaled;
child->getUnscaledPoints()[i]=childPoint;
}
m_cachedScaling = s;
}
update();
}
virtual void get_scale(vec3f& s) {
// const btVector3& scale = shape()->getLocalScaling();
// s = vec3f(scale.x(), scale.y(), scale.z());
s = vec3f(m_cachedScaling.x(), m_cachedScaling.y(), m_cachedScaling.z());
}
virtual float volume() { return m_volume; }
virtual vec3f const& local_inertia() { return m_local_inertia; }
virtual vec3f const& center() { return m_center; }
virtual quatf const& rotation() { return m_rotation; }
protected:
friend class bt_solver_t;
bt_convex_hull_shape_t(vec3f const* vertices, size_t num_vertices,
vec3f const* normals,
unsigned int const *indices, size_t num_indices):
bt_collision_shape_t(),
m_normals(normals, normals + num_vertices),
m_indices(indices, indices + num_indices)
{
m_volume = ::volume(vertices, (int*)indices, num_indices);
m_center = center_of_mass(vertices, (int*)indices, num_indices);
mat3x3f I = inertia(vertices, (int*)indices, num_indices, m_center);
m_rotation = diagonalizer(I);
mat3x3f Q, Qinv;
q_to_mat(m_rotation, Q);
q_to_mat(qconj(m_rotation), Qinv);
//D = trans(Q) * I * Q;
m_local_inertia = diag(prod(trans(Q), mat3x3f(prod(I, Q))));
m_vertices.resize(num_vertices);
for(size_t i = 0; i < m_vertices.size(); ++i) {
m_vertices[i] = prod(Qinv, vertices[i] - m_center);
}
m_ch_shape.reset(new btConvexHullShape((float const*)&(m_vertices[0]), num_vertices, sizeof(vec3f)));
btCompoundShape *compound_shape = new btCompoundShape;
// btTransform childTransf;
// childTransf.setIdentity();
// childTransf.setOrigin(btVector3(m_center[0], m_center[1], m_center[2]));
// compound_shape->addChildShape(childTransf, m_ch_shape.get());
///*
compound_shape->addChildShape(btTransform(btQuaternion(m_rotation[1],
m_rotation[2],
m_rotation[3],
m_rotation[0]),
btVector3(m_center[0],
m_center[1],
m_center[2])),
m_ch_shape.get());
//*/
set_shape(compound_shape);
m_cachedScaling[0] = m_cachedScaling[1] = m_cachedScaling[2] = 1.f;
}
void update()
{
//apply the scaling
btVector3 const& scale = m_ch_shape->getLocalScaling();
btVector3 const* points = m_ch_shape->getUnscaledPoints();
for(int i = 0; i < m_ch_shape->getNumPoints(); ++i) {
m_vertices[i] = vec3f(scale.x() * points[i].x(), scale.y() * points[i].y(), scale.z() * points[i].z());
}
m_volume = ::volume(&(m_vertices[0]), (int*)&(m_indices[0]), m_indices.size());
mat3x3f I = inertia(&(m_vertices[0]), (int*)&(m_indices[0]), (int)m_indices.size(), vec3f(0, 0, 0));
//std::cout << I << std::endl;
//m_rotation = diagonalizer(I);
//std::cout << rotation << std::endl;
//the rotation shouldn't change from scaling
mat3x3f Q, Qinv;
q_to_mat(m_rotation, Q);
q_to_mat(qconj(m_rotation), Qinv);
//D = Q * I * trans(Q);
m_local_inertia = diag(prod(trans(Q), mat3x3f(prod(I, Q))));
}
private:
shared_ptr<btConvexHullShape> m_ch_shape;
std::vector<vec3f> m_vertices;
std::vector<vec3f> m_normals;
std::vector<unsigned int> m_indices;
float m_volume;
vec3f m_center;
quatf m_rotation;
vec3f m_local_inertia;
btVector3 m_cachedScaling;
};
#endif

View File

@@ -1,168 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Walt Disney Studios
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Nicola Candussi <nicola@fluidinteractive.com>
*/
//bt_mesh_shape.h
#ifndef DYN_BT_MESH_SHAPE_H
#define DYN_BT_MESH_SHAPE_H
#include <vector>
#include <iterator>
#include "mesh_shape_impl.h"
#include "bt_collision_shape.h"
class bt_mesh_shape_t: public bt_collision_shape_t, public mesh_shape_impl_t
{
public:
virtual void gl_draw(size_t draw_style) {
if(m_vertices.empty() || m_indices.empty()) return;
btVector3 const& scale = shape()->getLocalScaling();
glPushMatrix();
glTranslatef(m_center[0], m_center[1], m_center[2]);
float angle;
vec3f axis;
q_to_axis_angle(m_rotation, axis, angle);
glRotatef(rad2deg(angle), axis[0], axis[1], axis[2]);
glScalef(scale.x(), scale.y(), scale.z());
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_NORMAL_ARRAY);
if(draw_style & collision_shape_t::kDSSolid) {
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
} else {
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
}
glVertexPointer(3, GL_FLOAT, 0, &(m_vertices[0]));
glNormalPointer(GL_FLOAT, 0, &(m_normals[0]));
glDrawElements(GL_TRIANGLES, m_indices.size(), GL_UNSIGNED_INT, &(m_indices[0]));
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_NORMAL_ARRAY);
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
glPopMatrix();
}
virtual void set_scale(vec3f const& s) {
btGImpactMeshShape *gi_shape = static_cast<btGImpactMeshShape*>(shape());
gi_shape->setLocalScaling(btVector3(s[0], s[1], s[2]));
gi_shape->updateBound();
update();
}
virtual void get_scale(vec3f& s) {
const btVector3& scale = shape()->getLocalScaling();
s = vec3f(scale.x(), scale.y(), scale.z());
}
virtual float volume() { return m_volume; }
virtual vec3f const& local_inertia() { return m_local_inertia; }
virtual vec3f const& center() { return m_center; }
virtual quatf const& rotation() { return m_rotation; }
protected:
friend class bt_solver_t;
bt_mesh_shape_t(vec3f const* vertices, size_t num_vertices,
vec3f const* normals,
unsigned int const *indices, size_t num_indices):
bt_collision_shape_t(),
m_normals(normals, normals + num_vertices),
m_indices(indices, indices + num_indices)
{
m_volume = ::volume(vertices, (int*)indices, num_indices);
m_center = center_of_mass(vertices, (int*)indices, num_indices);
mat3x3f I = inertia(vertices, (int*)indices, num_indices, m_center);
m_rotation = diagonalizer(I);
mat3x3f Q, Qinv;
q_to_mat(m_rotation, Q);
q_to_mat(qconj(m_rotation), Qinv);
//D = trans(Q) * I * Q;
m_local_inertia = diag(prod(trans(Q), mat3x3f(prod(I, Q))));
m_vertices.resize(num_vertices);
for(size_t i = 0; i < m_vertices.size(); ++i) {
m_vertices[i] = prod(Qinv, vertices[i] - m_center);
}
m_tiva.reset(new btTriangleIndexVertexArray(num_indices / 3, (int*)&(m_indices[0]), 3 * sizeof(unsigned int),
num_vertices, (float*)&(m_vertices[0]), sizeof(vec3f)));
m_gi_shape.reset(new btGImpactMeshShape(m_tiva.get()));
m_gi_shape->setLocalScaling(btVector3(1.0f,1.0f,1.0f));
m_gi_shape->updateBound();
btCompoundShape *compound_shape = new btCompoundShape;
compound_shape->addChildShape(btTransform(btQuaternion(m_rotation[1],
m_rotation[2],
m_rotation[3],
m_rotation[0]),
btVector3(m_center[0],
m_center[1],
m_center[2])),
m_gi_shape.get());
set_shape(compound_shape);
//std::cout << "construtor: " << m_center << std::endl;
// gimpactShape->setMargin(0.05);
}
void update()
{
//apply the scaling
btVector3 const& scale = m_gi_shape->getLocalScaling();
std::vector<vec3f> vertices(m_vertices.size());
for(unsigned int i = 0; i < vertices.size(); ++i) {
vertices[i] = vec3f(scale.x() * m_vertices[i][0], scale.y() * m_vertices[i][1], scale.z() * m_vertices[i][2]);
}
m_volume = ::volume(&(vertices[0]), (int*)&(m_indices[0]), (int)m_indices.size());
mat3x3f I = inertia(&(vertices[0]), (int*)&(m_indices[0]), (int)m_indices.size(), vec3f(0, 0, 0));
// std::cout << I << std::endl;
//m_rotation = diagonalizer(I);
//std::cout << rotation << std::endl;
//the rotation shouldn't change from scaling
mat3x3f Q, Qinv;
q_to_mat(m_rotation, Q);
q_to_mat(qconj(m_rotation), Qinv);
//D = Q * I * trans(Q);
m_local_inertia = diag(prod(trans(Q), mat3x3f(prod(I, Q))));
}
private:
shared_ptr<btGImpactMeshShape> m_gi_shape;
std::vector<vec3f> m_vertices;
std::vector<vec3f> m_normals;
std::vector<unsigned int> m_indices;
shared_ptr<btTriangleIndexVertexArray> m_tiva;
float m_volume;
vec3f m_center;
quatf m_rotation;
vec3f m_local_inertia;
};
#endif

View File

@@ -1,88 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Walt Disney Studios
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Nicola Candussi <nicola@fluidinteractive.com>
Modified by Roman Ponomarev <rponom@gmail.com>
12/24/2009 : Nail constraint improvements
*/
//bt_plane_shape.h
#ifndef DYN_BT_PLANE_SHAPE_H
#define DYN_BT_PLANE_SHAPE_H
#include "plane_shape_impl.h"
#include "drawUtils.h"
class bt_plane_shape_t: public bt_collision_shape_t, public plane_shape_impl_t
{
public:
virtual void gl_draw(size_t draw_style)
{
// std::cout << "bt_plane_shape_t::draw" << std::endl;
// btStaticPlaneShape *plane_shape = static_cast<btStaticPlaneShape*>(shape());
glPushMatrix();
glScalef(100.0f, 0.001f, 100.0f);
if(draw_style & collision_shape_t::kDSSolid) {
solid_cube();
} else {
wire_cube();
}
glPopMatrix();
}
virtual void set_scale(vec3f const& s) {
shape()->setLocalScaling(btVector3(s[0], s[1], s[2]));
}
virtual void get_scale(vec3f& s) {
const btVector3& scale = shape()->getLocalScaling();
s = vec3f(scale.x(), scale.y(), scale.z());
}
virtual float volume() { return m_volume; }
virtual vec3f const& local_inertia() { return m_local_inertia; }
virtual vec3f const& center() { return m_center; }
virtual quatf const& rotation() { return m_rotation; }
protected:
friend class bt_solver_t;
bt_plane_shape_t(vec3f const& normal, float d):
bt_collision_shape_t(),
m_volume(0),
m_local_inertia(1, 1, 1),
m_center(0, 0, 0),
m_rotation(qidentity<float>())
{
set_shape(new btStaticPlaneShape(btVector3(normal[0], normal[1], normal[2]), d));
// shape()->setMargin(0.1);
}
private:
float m_volume;
vec3f m_center;
quatf m_rotation;
vec3f m_local_inertia;
};
#endif

View File

@@ -1,220 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Walt Disney Studios
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Nicola Candussi <nicola@fluidinteractive.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/
//bt_rigid_body.h
#ifndef DYN_BT_RIGID_BODY_H
#define DYN_BT_RIGID_BODY_H
#include "shared_ptr.h"
#include "rigid_body_impl.h"
#include "bt_collision_shape.h"
#include "LinearMath/btAlignedObjectArray.h"
#include "constraint/bt_constraint.h"
class bt_rigid_body_t: public rigid_body_impl_t {
public:
virtual void get_transform(mat4x4f &xform) const
{
float m[16];
m_body->getWorldTransform().getOpenGLMatrix(m);
xform = trans(cmat<float, 4, 4>(m));
}
virtual void get_transform(vec3f &position, quatf &rotation) const
{
const btTransform& btxform = m_body->getWorldTransform();
btQuaternion q = btxform.getRotation();
btVector3 p = btxform.getOrigin();
position = vec3f(p.x(), p.y(), p.z());
rotation = quatf(q.w(), q.x(), q.y(), q.z());
}
virtual void set_transform(vec3f const &position, quatf const &rotation)
{
vec3f tp = position;
quatf tr = rotation;
btTransform xform(btQuaternion(tr[1], tr[2], tr[3], tr[0]),
btVector3(tp[0], tp[1], tp[2]));
m_body->setWorldTransform(xform);
// static bodies may got false "impulse" when editing in Maya, so...
m_body->setInterpolationWorldTransform(xform);
}
virtual void set_interpolation_transform(vec3f const &position, quatf const &rotation)
{
vec3f tp = position;
quatf tr = rotation;
btTransform xform(btQuaternion(tr[1], tr[2], tr[3], tr[0]),
btVector3(tp[0], tp[1], tp[2]));
m_body->setInterpolationWorldTransform(xform);
}
virtual void set_kinematic(bool kinematic)
{
if(kinematic) {
m_body->setCollisionFlags(m_body->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT);
m_body->setActivationState(DISABLE_DEACTIVATION);
m_body->setMassProps(0, btVector3(0.0,0.0,0.0));
m_body->updateInertiaTensor();
} else {
m_body->setCollisionFlags(m_body->getCollisionFlags() & ~btCollisionObject::CF_KINEMATIC_OBJECT);
m_body->setActivationState(ACTIVE_TAG);
m_body->setMassProps(m_mass, m_inertia);
m_body->updateInertiaTensor();
}
}
virtual void set_mass(float mass)
{
// std::cout << "bt_rigid_body::set_mass: " << mass << std::endl;
m_mass = mass;
if(m_body->getCollisionFlags() & btCollisionObject::CF_KINEMATIC_OBJECT) {
m_body->setMassProps(0, btVector3(0,0,0));
} else {
m_body->setMassProps(m_mass, m_inertia);
}
m_body->updateInertiaTensor();
}
virtual void set_inertia(vec3f const& I)
{
m_inertia = btVector3(I[0], I[1], I[2]);
if(m_body->getCollisionFlags() & btCollisionObject::CF_KINEMATIC_OBJECT) {
m_body->setMassProps(0, btVector3(0,0,0));
} else {
m_body->setMassProps(m_mass, m_inertia);
}
m_body->updateInertiaTensor();
}
virtual void set_restitution(float r)
{
m_body->setRestitution(r);
}
virtual void set_friction(float f)
{
m_body->setFriction(f);
}
virtual void set_linear_damping(float d)
{
m_linear_damping = d;
m_body->setDamping(m_linear_damping, m_angular_damping);
}
virtual void set_angular_damping(float d)
{
m_angular_damping = d;
m_body->setDamping(m_linear_damping, m_angular_damping);
}
virtual void set_linear_velocity(vec3f const& v)
{
m_body->setLinearVelocity(btVector3(v[0], v[1], v[2]));
}
virtual void get_linear_velocity(vec3f& v) const
{
const btVector3 &val = m_body->getLinearVelocity();
v = vec3f(val.x(), val.y(), val.z());
}
virtual void set_angular_velocity(vec3f const& v)
{
m_body->setAngularVelocity(btVector3(v[0], v[1], v[2]));
}
virtual void get_angular_velocity(vec3f& v) const
{
const btVector3 &val = m_body->getAngularVelocity();
v = vec3f(val.x(), val.y(), val.z());
}
virtual void clear_forces()
{
m_body->clearForces();
}
virtual void apply_central_force(vec3f const& f)
{
m_body->applyCentralForce(btVector3(f[0], f[1], f[2]));
}
virtual void apply_torque(vec3f const& t)
{
m_body->applyTorque(btVector3(t[0], t[1], t[2]));
}
virtual void update_constraint()
{
int count = m_constraintRef.size();
for(int i=0; i<count; i++)
{
m_constraintRef[i]->update_constraint(this);
}
}
btRigidBody* body() { return m_body.get(); }
virtual void add_constraint(bt_constraint_t* constraint)
{
m_constraintRef.push_back(constraint);
}
virtual void remove_constraint(bt_constraint_t* constraint)
{
m_constraintRef.remove(constraint);
}
protected:
friend class bt_solver_t;
btAlignedObjectArray<bt_constraint_t*> m_constraintRef;
bt_rigid_body_t(collision_shape_impl_t* cs):
m_collision_shape(cs),
m_mass(1),
m_inertia(2.0f/5.0f, 2.0f/5.0f, 2.0f/5.0f),
m_linear_damping(0),
m_angular_damping(0)
{
bt_collision_shape_t* bt_shape = dynamic_cast<bt_collision_shape_t*>(cs);
btRigidBody::btRigidBodyConstructionInfo rbInfo(m_mass, NULL, bt_shape->shape(), m_inertia);
rbInfo.m_restitution = 0;
rbInfo.m_friction = 0.1f;
rbInfo.m_linearDamping = m_linear_damping;
rbInfo.m_angularDamping = m_angular_damping;
m_body.reset(new btRigidBody(rbInfo));
}
private:
shared_ptr<btRigidBody> m_body;
collision_shape_impl_t* m_collision_shape;
float m_mass;
btVector3 m_inertia;
float m_linear_damping;
float m_angular_damping;
};
#endif

View File

@@ -1,126 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Walt Disney Studios
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Nicola Candussi <nicola@fluidinteractive.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
01/27/2010 : Replaced COLLADA export with Bullet binary export
*/
//bt_solver.cpp
#include "LinearMath/btSerializer.h"
#include "bt_solver.h"
//#include "../BulletColladaConverter/ColladaConverter.h"
//#include "../Serialize/BulletFileLoader/btBulletFile.h"
btVector3 minWorld(-10000,-10000,-10000);
btVector3 maxWorld(10000,10000,10000);
int maxNumObj=32768;
void bt_solver_t::export_bullet_file(const char* fileName)
{
// ColladaConverter tmpConverter(m_dynamicsWorld.get());
// tmpConverter.save(fileName);
FILE* f2 = fopen(fileName,"wb");
if(f2 == NULL)
{
fprintf(stderr,"Error: Can't open file %s for writing\n", fileName);
return;
}
int maxSerializeBufferSize = 1024*1024*5;
btDefaultSerializer* serializer = new btDefaultSerializer(maxSerializeBufferSize);
m_dynamicsWorld->serialize(serializer);
fwrite(serializer->getBufferPointer(),serializer->getCurrentBufferSize(),1,f2);
fclose(f2);
delete serializer;
}
void bt_solver_t::import_bullet_file(const char* filename)
{
//todo: need to create actual bodies etc
// ColladaConverter tmpConverter(m_dynamicsWorld.get());
// tmpConverter.load(filename);
}
class bt_debug_draw : public btIDebugDraw
{
int m_debugMode;
public:
virtual void drawLine(const btVector3& from,const btVector3& to,const btVector3& color)
{
glBegin(GL_LINES);
glColor3f(color.getX(), color.getY(), color.getZ());
glVertex3d(from.getX(), from.getY(), from.getZ());
glVertex3d(to.getX(), to.getY(), to.getZ());
glEnd();
}
virtual void drawContactPoint(const btVector3& PointOnB,const btVector3& normalOnB,btScalar distance,int lifeTime,const btVector3& color)
{
return;
}
virtual void reportErrorWarning(const char* warningString)
{
return;
}
virtual void draw3dText(const btVector3& location,const char* textString)
{
return;
}
virtual void setDebugMode(int debugMode) { m_debugMode = debugMode; }
virtual int getDebugMode() const { return m_debugMode; }
};
bt_solver_t::bt_solver_t():
// m_broadphase(new btAxisSweep3(minWorld,maxWorld,maxNumObj)),
m_broadphase(new btDbvtBroadphase()),
m_solver(new btSequentialImpulseConstraintSolver),
m_collisionConfiguration(new btDefaultCollisionConfiguration),
m_dispatcher(new btCollisionDispatcher(m_collisionConfiguration.get())),
m_dynamicsWorld(new btDiscreteDynamicsWorld(m_dispatcher.get(),
m_broadphase.get(),
m_solver.get(),
m_collisionConfiguration.get()))
{
//register algorithm for concave meshes
btGImpactCollisionAlgorithm::registerAlgorithm(m_dispatcher.get());
m_dynamicsWorld->setGravity(btVector3(0, -9.81f, 0));
// m_dynamicsWorld->getSolverInfo().m_splitImpulse = true;
bt_debug_draw* dbgDraw = new bt_debug_draw();
m_dynamicsWorld->setDebugDrawer(dbgDraw);
}
void bt_solver_t::debug_draw(int dbgMode)
{
m_dynamicsWorld->getDebugDrawer()->setDebugMode(dbgMode);
m_dynamicsWorld->debugDrawWorld();
}

View File

@@ -1,175 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Walt Disney Studios
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Nicola Candussi <nicola@fluidinteractive.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
01/27/2010 : Replaced COLLADA export with Bullet binary export
*/
//bt_solver.h
#ifndef DYN_BT_SOLVER_H
#define DYN_BT_SOLVER_H
#include "btBulletCollisionCommon.h"
#include "btBulletDynamicsCommon.h"
#include "BulletCollision/Gimpact/btGImpactShape.h"
#include "BulletCollision/Gimpact/btGImpactCollisionAlgorithm.h"
#include "solver_impl.h"
#include "bt_rigid_body.h"
#include "bt_sphere_shape.h"
#include "bt_plane_shape.h"
#include "bt_box_shape.h"
#include "bt_convex_hull_shape.h"
#include "bt_mesh_shape.h"
#include "constraint/bt_nail_constraint.h"
#include "constraint/bt_hinge_constraint.h"
#include "constraint/bt_slider_constraint.h"
#include "constraint/bt_sixdof_constraint.h"
class bt_solver_t: public solver_impl_t
{
public:
virtual rigid_body_impl_t* create_rigid_body(collision_shape_impl_t* cs) {
return new bt_rigid_body_t(cs);
}
virtual collision_shape_impl_t* create_sphere_shape(float radius) {
return new bt_sphere_shape_t(radius);
}
virtual collision_shape_impl_t* create_plane_shape(vec3f const& normal, float d) {
return new bt_plane_shape_t(normal, d);
}
virtual collision_shape_impl_t* create_box_shape(vec3f const& halfExtents) {
return new bt_box_shape_t(halfExtents);
}
virtual collision_shape_impl_t* create_convex_hull_shape(vec3f const* vertices, size_t num_vertices,
vec3f const* normals,
unsigned int const *indices, size_t num_indices)
{
return new bt_convex_hull_shape_t(vertices, num_vertices, normals, indices, num_indices);
}
virtual collision_shape_impl_t* create_mesh_shape(vec3f const* vertices, size_t num_vertices,
vec3f const* normals,
unsigned int const *indices, size_t num_indices)
{
return new bt_mesh_shape_t(vertices, num_vertices, normals, indices, num_indices);
}
virtual nail_constraint_impl_t* create_nail_constraint(rigid_body_impl_t* rb, vec3f const& pivot)
{
return new bt_nail_constraint_t(rb, pivot);
}
virtual nail_constraint_impl_t* create_nail_constraint(rigid_body_impl_t* rbA, rigid_body_impl_t* rbB, vec3f const& pivotInA, vec3f const& pivotInB)
{
return new bt_nail_constraint_t(rbA, rbB, pivotInA, pivotInB);
}
virtual hinge_constraint_impl_t* create_hinge_constraint(rigid_body_impl_t* rb, vec3f const& pivot, quatf const& rot)
{
return new bt_hinge_constraint_t(rb, pivot, rot);
}
virtual hinge_constraint_impl_t* create_hinge_constraint(rigid_body_impl_t* rbA, vec3f const& pivotA, quatf const& rotA, rigid_body_impl_t* rbB, vec3f const& pivotB, quatf const& rotB)
{
return new bt_hinge_constraint_t(rbA, pivotA, rotA, rbB, pivotB, rotB);
}
virtual slider_constraint_impl_t* create_slider_constraint(rigid_body_impl_t* rb, vec3f const& pivot, quatf const& rot)
{
return new bt_slider_constraint_t(rb, pivot, rot);
}
virtual slider_constraint_impl_t* create_slider_constraint(rigid_body_impl_t* rbA, vec3f const& pivotA, quatf const& rotA, rigid_body_impl_t* rbB, vec3f const& pivotB, quatf const& rotB)
{
return new bt_slider_constraint_t(rbA, pivotA, rotA, rbB, pivotB, rotB);
}
virtual sixdof_constraint_impl_t* create_sixdof_constraint(rigid_body_impl_t* rb, vec3f const& pivot, quatf const& rot)
{
return new bt_sixdof_constraint_t(rb, pivot, rot);
}
virtual sixdof_constraint_impl_t* create_sixdof_constraint(rigid_body_impl_t* rbA, vec3f const& pivotA, quatf const& rotA, rigid_body_impl_t* rbB, vec3f const& pivotB, quatf const& rotB)
{
return new bt_sixdof_constraint_t(rbA, pivotA, rotA, rbB, pivotB, rotB);
}
virtual void add_rigid_body(rigid_body_impl_t* rb)
{
bt_rigid_body_t* bt_body = static_cast<bt_rigid_body_t*>(rb);
bt_body->body()->setActivationState(DISABLE_DEACTIVATION);
m_dynamicsWorld->addRigidBody(bt_body->body());
}
virtual void remove_rigid_body(rigid_body_impl_t* rb)
{
bt_rigid_body_t* bt_body = static_cast<bt_rigid_body_t*>(rb);
m_dynamicsWorld->removeRigidBody(bt_body->body());
}
virtual void add_constraint(constraint_impl_t* c)
{
bt_constraint_t* btc = dynamic_cast<bt_constraint_t*>(c);
m_dynamicsWorld->addConstraint(btc->constraint(), true);
}
virtual void remove_constraint(constraint_impl_t* c)
{
bt_constraint_t* btc = dynamic_cast<bt_constraint_t*>(c);
m_dynamicsWorld->removeConstraint(btc->constraint());
}
virtual void set_gravity(vec3f const& g)
{
m_dynamicsWorld->setGravity(btVector3(g[0], g[1], g[2]));
}
virtual void set_split_impulse(bool enabled)
{
m_dynamicsWorld->getSolverInfo().m_splitImpulse = enabled;
}
virtual void step_simulation(float dt)
{
m_dynamicsWorld->stepSimulation(dt, 1000, 1.0f / 120.0f);
}
virtual void debug_draw(int dbgMode);
virtual void export_bullet_file(const char* fileName);
virtual void import_bullet_file(const char* filename);
protected:
friend class solver_t;
bt_solver_t();
private:
shared_ptr<btBroadphaseInterface> m_broadphase;
shared_ptr<btConstraintSolver> m_solver;
shared_ptr<btDefaultCollisionConfiguration> m_collisionConfiguration;
shared_ptr<btCollisionDispatcher> m_dispatcher;
shared_ptr<btDiscreteDynamicsWorld> m_dynamicsWorld;
};
#endif

View File

@@ -1,111 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Walt Disney Studios
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Nicola Candussi <nicola@fluidinteractive.com>
Modified by Roman Ponomarev <rponom@gmail.com>
12/24/2009 : Nail constraint improvements
*/
//bt_sphere_shape.h
#ifndef DYN_BT_SPHERE_SHAPE_H
#define DYN_BT_SPHERE_SHAPE_H
#ifdef WIN32//for glut.h
#include <windows.h>
#endif
//think different
#if defined(__APPLE__) && !defined (VMDMESA)
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#else
#include <GL/gl.h>
#endif
#include "sphere_shape_impl.h"
#include "bt_collision_shape.h"
#include "collision_shape.h"
#include "drawUtils.h"
class bt_sphere_shape_t: public bt_collision_shape_t, public sphere_shape_impl_t
{
public:
virtual void gl_draw(size_t draw_style) {
btSphereShape *sphere_shape = static_cast<btSphereShape*>(shape());
glPushMatrix();
glScalef(sphere_shape->getRadius(), sphere_shape->getRadius(), sphere_shape->getRadius());
if(draw_style & collision_shape_t::kDSSolid) {
solid_sphere();
} else {
wire_sphere();
}
glPopMatrix();
}
virtual void set_scale(vec3f const& s) {
shape()->setLocalScaling(btVector3(s[0], s[1], s[2]));
update();
}
virtual void get_scale(vec3f& s) {
const btVector3& scale = shape()->getLocalScaling();
s = vec3f(scale.x(), scale.y(), scale.z());
}
virtual float volume() { return m_volume; }
virtual vec3f const& local_inertia() { return m_local_inertia; }
virtual vec3f const& center() { return m_center; }
virtual quatf const& rotation() { return m_rotation; }
protected:
friend class bt_solver_t;
bt_sphere_shape_t(float radius):
bt_collision_shape_t()
{
set_shape(new btSphereShape(radius));
// shape()->setMargin(0.1);
update();
}
void update()
{
btSphereShape *sphere_shape = static_cast<btSphereShape*>(shape());
float radius = sphere_shape->getRadius();
m_volume = (4.0f * 3.1415926f * radius * radius * radius) / 3.0f;
m_center = vec3f(0, 0, 0);
m_rotation = qidentity<float>();
m_local_inertia = vec3f(2.0f / 5.0f * radius * radius,
2.0f / 5.0f * radius * radius,
2.0f / 5.0f * radius * radius);
}
private:
float m_volume;
vec3f m_center;
quatf m_rotation;
vec3f m_local_inertia;
};
#endif

View File

@@ -1,81 +0,0 @@
; example1.nsi
;
; This script is perhaps one of the simplest NSIs you can make. All of the
; optional settings are left to their default settings. The installer simply
; prompts the user asking them where to install, and drops a copy of "MyProg.exe"
; there.
;--------------------------------
; The name of the installer
Name "Dynamica Bullet 2.76 physics plugin for Maya 2009"
; The file to write
OutFile "DynamicaForMaya2009_64bit.exe"
; The default installation directory
InstallDir $PROGRAMFILES\DynamicaBullet2.76\
UninstPage uninstConfirm
UninstPage instfiles
; The text to prompt the user to enter a directory
DirText "This will install Dynamica Bullet For Maya. Choose destination directory"
;--------------------------------
; The stuff to install
Section "" ;No components page, name is not important
;Create Dynamica directories
;CreateDirectory "$INSTDIR\dll"
CreateDirectory "$INSTDIR\doc"
CreateDirectory "$INSTDIR\scenes\"
CreateDirectory "$INSTDIR\icons"
CreateDirectory "$INSTDIR\plug-ins"
CreateDirectory "$INSTDIR\scripts"
;SetOutPath "$INSTDIR\dll"
;File "dll\*.dll"
SetOutPath "$INSTDIR\doc"
File "doc\*.*"
SetOutPath "$INSTDIR\scenes"
File "scenes\*.*"
SetOutPath "$INSTDIR\icons"
File "icons\*.*"
SetOutPath "$INSTDIR\plug-ins"
File "BulletMayaPlugin.mll"
;File "C:\Program Files\Microsoft Visual Studio 8\VC\redist\x86\Microsoft.VC80.CRT\msvcp80.dll"
;File "C:\Program Files\Microsoft Visual Studio 8\VC\redist\x86\Microsoft.VC80.CRT\msvcr80.dll"
File "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT\msvcp90.dll"
File "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT\msvcr90.dll"
SetOutPath "$INSTDIR\scripts"
File "scripts\*.*"
SetOutPath "$DOCUMENTS\maya\modules\"
File "BulletDynamica.6_module"
FileOpen $0 $DOCUMENTS\maya\modules\BulletDynamica.6_module a
FileSeek $0 0 END
FileWrite $0 "$INSTDIR$\n"
FileClose $0
CreateDirectory "$SMPROGRAMS\Dynamica Bullet"
CreateShortCut "$SMPROGRAMS\Dynamica Bullet\Documentation.lnk" "$INSTDIR\doc\index.html"
CreateShortCut "$SMPROGRAMS\Dynamica Bullet\Examples.lnk" "$INSTDIR\scenes\"
CreateShortCut "$SMPROGRAMS\Dynamica Bullet\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
ExecShell "open" "$INSTDIR\doc\index.html"
WriteUninstaller $INSTDIR\Uninstall.exe
SectionEnd ; end the section
Section "Uninstall"
ClearErrors
MessageBox MB_YESNO "Uninstall Bullet for MAYA?" IDNO end
Delete "$DOCUMENTS\maya\modules\DynamicaBullet.6_module"
RMDir /r "$SMPROGRAMS\Dynamica Bullet\"
RMDir /r "$INSTDIR"
end:
SectionEnd

View File

@@ -1,160 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Modified by Roman Ponomarev <rponom@gmail.com>
01/27/2010 : Replaced COLLADA export with Bullet binary export
*/
#include "bulletExport.h"
#include "solver.h"
#include "solver_impl.h"
#if defined (_WIN32)
#define strcasecmp stricmp
#elif defined (OSMac_)
extern "C" int strcasecmp (const char *, const char *);
#endif
#define NO_SMOOTHING_GROUP -1
#define INITIALIZE_SMOOTHING -2
#define INVALID_ID -1
//////////////////////////////////////////////////////////////
MString ObjTranslator::fExtension = "bullet";
//////////////////////////////////////////////////////////////
void* ObjTranslator::creator()
{
return new ObjTranslator();
}
//////////////////////////////////////////////////////////////
MStatus ObjTranslator::reader ( const MFileObject& file,
const MString& options,
FileAccessMode mode)
{
fprintf(stderr, "Bullet Physics import is not available yet\n");
return MS::kFailure;
}
MStatus ObjTranslator::writer ( const MFileObject& file,
const MString& options,
FileAccessMode mode )
{
MStatus status;
MString mname = file.fullName(), unitName;
//just pass in the filename
#if defined (OSMac_)
char fname[256];//MAXPATHLEN];
strcpy (fname, file.fullName().asChar());
// fp = fopen(fname,"wb");//MAYAMACTODO
#else
const char *fname = mname.asChar();
// fp = fopen(fname,"w");
#endif
shared_ptr<solver_impl_t> solv = solver_t::get_solver();
solv->export_bullet_file(fname);
return status;
}
//////////////////////////////////////////////////////////////
bool ObjTranslator::haveReadMethod () const
{
return true;
}
//////////////////////////////////////////////////////////////
bool ObjTranslator::haveWriteMethod () const
{
return true;
}
//////////////////////////////////////////////////////////////
MString ObjTranslator::defaultExtension () const
{
// return MString("bullet");
return fExtension;
}
MString ObjTranslator::filter() const
{
//return "*.bullet;*.dae";
return "*.bullet";
}
//////////////////////////////////////////////////////////////
MPxFileTranslator::MFileKind ObjTranslator::identifyFile (
const MFileObject& fileName,
const char* buffer,
short size) const
{
const char * name = fileName.name().asChar();
int nameLength = strlen(name);
if ((nameLength > 7) && !strcasecmp(name+nameLength-7, ".bullet"))
return kCouldBeMyFileType;
else
return kNotMyFileType;
}
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
MStatus ObjTranslator::exportSelected( )
{
MStatus status;
MString filename;
// Create an iterator for the active selection list
//
MSelectionList slist;
MGlobal::getActiveSelectionList( slist );
MItSelectionList iter( slist );
if (iter.isDone()) {
fprintf(stderr,"Error: Nothing is selected.\n");
return MS::kFailure;
}
return status;
}
//////////////////////////////////////////////////////////////
MStatus ObjTranslator::exportAll( )
{
MStatus status = MS::kSuccess;
return status;
}

View File

@@ -1,97 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Modified by Roman Ponomarev <rponom@gmail.com>
01/27/2010 : Replaced COLLADA export with Bullet binary export
*/
#ifndef BULLET_EXPORT_H
#define BULLET_EXPORT_H
#include <string.h>
#include <sys/types.h>
#include <maya/MStatus.h>
#include <maya/MPxCommand.h>
#include <maya/MString.h>
#include <maya/MStringArray.h>
#include <maya/MArgList.h>
#include <maya/MGlobal.h>
#include <maya/MSelectionList.h>
#include <maya/MItSelectionList.h>
#include <maya/MPoint.h>
#include <maya/MPointArray.h>
#include <maya/MDagPath.h>
#include <maya/MDagPathArray.h>
//#include <maya/MFnPlugin.h>
#include <maya/MFnMesh.h>
#include <maya/MFnSet.h>
#include <maya/MItMeshPolygon.h>
#include <maya/MItMeshVertex.h>
#include <maya/MItMeshEdge.h>
#include <maya/MFloatVector.h>
#include <maya/MFloatVectorArray.h>
#include <maya/MFloatArray.h>
#include <maya/MObjectArray.h>
#include <maya/MObject.h>
//#include <maya/MPlug.h>
#include <maya/MPxFileTranslator.h>
#include <maya/MFnDagNode.h>
#include <maya/MItDag.h>
#include <maya/MDistance.h>
#include <maya/MIntArray.h>
#include <maya/MIOStream.h>
//////////////////////////////////////////////////////////////
class ObjTranslator : public MPxFileTranslator {
public:
ObjTranslator () {};
virtual ~ObjTranslator () {};
static void* creator();
MStatus reader ( const MFileObject& file,
const MString& optionsString,
FileAccessMode mode);
MStatus writer ( const MFileObject& file,
const MString& optionsString,
FileAccessMode mode );
bool haveReadMethod () const;
bool haveWriteMethod () const;
MString defaultExtension () const;
MString filter() const;
MFileKind identifyFile ( const MFileObject& fileName,
const char* buffer,
short size) const;
protected:
static MString fExtension;
private:
MStatus exportSelected();
MStatus exportAll();
private:
};
#endif //BULLET_EXPORT_H

View File

@@ -1,323 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Walt Disney Studios
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Nicola Candussi <nicola@fluidinteractive.com>
*/
//collisionShapeNode.cpp
#include <maya/MFnMessageAttribute.h>
#include <maya/MFnNumericAttribute.h>
#include <maya/MFnEnumAttribute.h>
#include <maya/MPlugArray.h>
#include <maya/MFloatPointArray.h>
#include <maya/MFloatVectorArray.h>
#include <maya/MIntArray.h>
#include <maya/MFnMesh.h>
#include <maya/MDagPath.h>
#include <iterator>
#include <vector>
#include <assert.h>
#include "collisionShapeNode.h"
#include "mayaUtils.h"
#include "solver.h"
MTypeId collisionShapeNode::typeId(0x100332);
MString collisionShapeNode::typeName("dCollisionShape");
MObject collisionShapeNode::ia_shape;
MObject collisionShapeNode::ia_type;
MObject collisionShapeNode::ia_scale;
MObject collisionShapeNode::ca_collisionShape;
MObject collisionShapeNode::ca_collisionShapeParam;
MObject collisionShapeNode::oa_collisionShape;
MStatus collisionShapeNode::initialize()
{
MStatus status;
MFnMessageAttribute fnMsgAttr;
MFnNumericAttribute fnNumericAttr;
MFnEnumAttribute fnEnumAttr;
ia_type = fnEnumAttr.create("type", "tp", 5, &status);
MCHECKSTATUS(status, "creating type attribute")
fnEnumAttr.addField("Convex Hull", 0);
fnEnumAttr.addField("Mesh", 1);
fnEnumAttr.addField("Cylinder", 2);
fnEnumAttr.addField("Capsule", 3);
fnEnumAttr.addField("Box", 4);
fnEnumAttr.addField("Sphere", 5);
fnEnumAttr.addField("Plane", 6);
fnEnumAttr.setKeyable(true);
status = addAttribute(ia_type);
MCHECKSTATUS(status, "adding type attribute")
ia_scale = fnNumericAttr.createPoint("scale", "sc", &status);
MCHECKSTATUS(status, "creating ia_scale attribute")
fnNumericAttr.setDefault(1.0, 1.0, 1.0);
fnNumericAttr.setKeyable(true);
status = addAttribute(ia_scale);
MCHECKSTATUS(status, "adding ia_scale attribute")
oa_collisionShape = fnMsgAttr.create("outCollisionShape", "oucs", &status);
MCHECKSTATUS(status, "creating outCollisionShape attribute")
status = addAttribute(oa_collisionShape);
MCHECKSTATUS(status, "adding outCollisionShape attribute")
ia_shape = fnMsgAttr.create("inShape", "insh", &status);
MCHECKSTATUS(status, "creating inShape attribute")
status = addAttribute(ia_shape);
MCHECKSTATUS(status, "adding inShape attribute")
ca_collisionShape = fnNumericAttr.create("ca_collisionShape", "ccs", MFnNumericData::kBoolean, 0, &status);
MCHECKSTATUS(status, "creating ca_collisionShape attribute")
fnNumericAttr.setConnectable(false);
fnNumericAttr.setHidden(true);
fnNumericAttr.setStorable(false);
fnNumericAttr.setKeyable(false);
status = addAttribute(ca_collisionShape);
MCHECKSTATUS(status, "adding ca_collisionShape attribute")
ca_collisionShapeParam = fnNumericAttr.create("collisionShapeParam", "cspm", MFnNumericData::kBoolean, 0, &status);
MCHECKSTATUS(status, "creating ca_collisionShapeParam attribute")
fnNumericAttr.setConnectable(false);
fnNumericAttr.setHidden(true);
fnNumericAttr.setStorable(false);
fnNumericAttr.setKeyable(false);
status = addAttribute(ca_collisionShapeParam);
MCHECKSTATUS(status, "adding ca_collisionShapeParam attribute")
//
status = attributeAffects(ia_shape, oa_collisionShape);
MCHECKSTATUS(status, "adding attributeAffects(ia_shape, oa_collisionShape)")
status = attributeAffects(ia_type, oa_collisionShape);
MCHECKSTATUS(status, "adding attributeAffects(ia_type, oa_collisionShape)")
status = attributeAffects(ia_scale, oa_collisionShape);
MCHECKSTATUS(status, "adding attributeAffects(ia_scale, oa_collisionShape)")
//
status = attributeAffects(ia_shape, ca_collisionShape);
MCHECKSTATUS(status, "adding attributeAffects(ia_shape, ca_collisionShape)")
status = attributeAffects(ia_type, ca_collisionShape);
MCHECKSTATUS(status, "adding attributeAffects(ia_shape, ca_collisionShape)")
//
status = attributeAffects(ia_shape, ca_collisionShapeParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_shape, oa_collisionShapeParam)")
status = attributeAffects(ia_scale, ca_collisionShapeParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_scale, oa_collisionShapeParam)")
status = attributeAffects(ia_type, ca_collisionShapeParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_type, oa_collisionShapeParam)")
return MS::kSuccess;
}
collisionShapeNode::collisionShapeNode()
{
// std::cout << "collisionShapeNode::collisionShapeNode" << std::endl;
}
collisionShapeNode::~collisionShapeNode()
{
// std::cout << "collisionShapeNode::~collisionShapeNode" << std::endl;
}
void* collisionShapeNode::creator()
{
return new collisionShapeNode();
}
bool collisionShapeNode::setInternalValueInContext ( const MPlug & plug,
const MDataHandle & dataHandle,
MDGContext & ctx)
{
return false; //setInternalValueInContext(plug,dataHandle,ctx);
}
MStatus collisionShapeNode::compute( const MPlug& plug, MDataBlock& data )
{
if(plug == oa_collisionShape) {
computeOutputShape(plug, data);
} else if(plug == ca_collisionShape) {
computeCollisionShape(plug, data);
} else if(plug == ca_collisionShapeParam) {
computeCollisionShapeParam(plug, data);
} else {
return MStatus::kUnknownParameter;
}
return MStatus::kSuccess;
}
collision_shape_t::pointer collisionShapeNode::collisionShape()
{
MObject thisObject(thisMObject());
MObject update;
MPlug(thisObject, oa_collisionShape).getValue(update);
MPlug(thisObject, ca_collisionShapeParam).getValue(update);
return m_collision_shape;
}
void collisionShapeNode::computeCollisionShape(const MPlug& plug, MDataBlock& data)
{
// std::cout << "collisionShapeNode::computeCollisionShape" << std::endl;
MObject thisObject(thisMObject());
MPlug plgInShape(thisObject, ia_shape);
MPlug plgType(thisObject, ia_type);
int type;
plgType.getValue(type);
switch(type) {
case 0:
{
//convex hull
MPlugArray plgaConnectedTo;
plgInShape.connectedTo(plgaConnectedTo, true, true);
if(plgaConnectedTo.length() > 0) {
MObject node = plgaConnectedTo[0].node();
if(node.hasFn(MFn::kMesh)) {
MDagPath dagPath;
MDagPath::getAPathTo(node, dagPath);
MFnMesh fnMesh(dagPath);
MFloatPointArray mpoints;
MFloatVectorArray mnormals;
MIntArray mtrianglecounts;
MIntArray mtrianglevertices;
fnMesh.getPoints(mpoints, MSpace::kObject);
fnMesh.getNormals(mnormals, MSpace::kObject);
fnMesh.getTriangles(mtrianglecounts, mtrianglevertices);
std::vector<vec3f> vertices(mpoints.length());
std::vector<vec3f> normals(mpoints.length());
std::vector<unsigned int> indices(mtrianglevertices.length());
for(size_t i = 0; i < vertices.size(); ++i) {
vertices[i] = vec3f(mpoints[i].x, mpoints[i].y, mpoints[i].z);
normals[i] = vec3f(mnormals[i].x, mnormals[i].y, mnormals[i].z);
}
for(size_t i = 0; i < indices.size(); ++i) {
indices[i] = mtrianglevertices[i];
}
m_collision_shape = solver_t::create_convex_hull_shape(&(vertices[0]), vertices.size(), &(normals[0]),
&(indices[0]), indices.size());
}
}
}
break;
case 1:
//mesh
{
//convex hull
MPlugArray plgaConnectedTo;
plgInShape.connectedTo(plgaConnectedTo, true, true);
if(plgaConnectedTo.length() > 0) {
MObject node = plgaConnectedTo[0].node();
if(node.hasFn(MFn::kMesh)) {
MDagPath dagPath;
MDagPath::getAPathTo(node, dagPath);
MFnMesh fnMesh(dagPath);
MFloatPointArray mpoints;
MFloatVectorArray mnormals;
MIntArray mtrianglecounts;
MIntArray mtrianglevertices;
fnMesh.getPoints(mpoints, MSpace::kObject);
fnMesh.getNormals(mnormals, MSpace::kObject);
fnMesh.getTriangles(mtrianglecounts, mtrianglevertices);
std::vector<vec3f> vertices(mpoints.length());
std::vector<vec3f> normals(mpoints.length());
std::vector<unsigned int> indices(mtrianglevertices.length());
for(size_t i = 0; i < vertices.size(); ++i) {
vertices[i] = vec3f(mpoints[i].x, mpoints[i].y, mpoints[i].z);
normals[i] = vec3f(mnormals[i].x, mnormals[i].y, mnormals[i].z);
}
for(size_t i = 0; i < indices.size(); ++i) {
indices[i] = mtrianglevertices[i];
}
m_collision_shape = solver_t::create_mesh_shape(&(vertices[0]), vertices.size(), &(normals[0]),
&(indices[0]), indices.size());
}
}
}
break;
case 2:
//cylinder
break;
case 3:
//capsule
break;
case 4:
//box
m_collision_shape = solver_t::create_box_shape();
break;
case 5:
//sphere
m_collision_shape = solver_t::create_sphere_shape();
break;
case 6:
//plane
m_collision_shape = solver_t::create_plane_shape();
break;
}
assert(m_collision_shape);
data.setClean(plug);
}
void collisionShapeNode::computeCollisionShapeParam(const MPlug& plug, MDataBlock& data)
{
// std::cout << "collisionShapeNode::computeCollisionShapeParam" << std::endl;
MObject thisObject(thisMObject());
MObject update;
MPlug(thisObject, ia_shape).getValue(update);
MPlug(thisObject, ia_type).getValue(update);
float3& scale = data.inputValue(ia_scale).asFloat3();
m_collision_shape->set_scale(vec3f(scale[0], scale[1], scale[2]));
data.setClean(plug);
}
void collisionShapeNode::computeOutputShape(const MPlug& plug, MDataBlock& data)
{
// std::cout << "collisionShapeNode::computeOutputShape" << std::endl;
MObject thisObject(thisMObject());
MObject update;
MPlug(thisObject, ca_collisionShape).getValue(update);
MPlug(thisObject, ca_collisionShapeParam).getValue(update);
data.setClean(plug);
}

View File

@@ -1,80 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Walt Disney Studios
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Nicola Candussi <nicola@fluidinteractive.com>
*/
//collisionShapeNode.h
#ifndef DYN_COLLISION_SHAPE_NODE_H
#define DYN_COLLISION_SHAPE_NODE_H
#include <maya/MString.h>
#include <maya/MTypeId.h>
#include <maya/MPxNode.h>
#include "collision_shape.h"
class collisionShapeNode: public MPxNode
{
public:
collisionShapeNode();
virtual ~collisionShapeNode();
virtual bool setInternalValueInContext ( const MPlug & plug,
const MDataHandle & dataHandle,
MDGContext & ctx);
virtual MStatus compute( const MPlug& plug, MDataBlock& data );
static void * creator();
static MStatus initialize();
public:
collision_shape_t::pointer collisionShape();
public:
//Attributes
static MObject ia_shape;
static MObject ia_type;
static MObject ia_scale;
static MObject ca_collisionShape;
static MObject ca_collisionShapeParam;
static MObject oa_collisionShape;
public:
static MTypeId typeId;
static MString typeName;
protected:
void computeCollisionShape(const MPlug& plug, MDataBlock& data);
void computeCollisionShapeParam(const MPlug& plug, MDataBlock& data);
void computeOutputShape(const MPlug& plug, MDataBlock& data);
private:
collision_shape_t::pointer m_collision_shape;
};
#endif

View File

@@ -1,68 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Walt Disney Studios
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Nicola Candussi <nicola@fluidinteractive.com>
*/
//collision_shape.h
#ifndef DYN_COLLISION_SHAPE_H
#define DYN_COLLISION_SHAPE_H
#include "shared_ptr.h"
#include "collision_shape_impl.h"
class collision_shape_t
{
public:
//typedefs
typedef shared_ptr<collision_shape_t> pointer;
//enums
enum DrawStyle {
kDSWireframe = 0x0001,
kDSSolid = 0x0002
};
virtual void gl_draw(size_t draw_style = kDSSolid) { m_impl->gl_draw(draw_style); }
virtual void set_scale(vec3f const& s) { m_impl->set_scale(s); }
virtual void get_scale(vec3f& s) { m_impl->get_scale(s); }
virtual float volume() { return m_impl->volume(); }
//for the inertia is assumed that the mass is 1.0. just multiply by the mass
virtual vec3f const& local_inertia() { return m_impl->local_inertia(); }
virtual vec3f const& center() { return m_impl->center(); }
virtual quatf const& rotation() { return m_impl->rotation(); }
public:
virtual ~collision_shape_t() {}
protected:
friend class solver_t;
collision_shape_t(collision_shape_impl_t* impl): m_impl(impl) { }
collision_shape_impl_t* impl() { return m_impl.get(); }
private:
shared_ptr<collision_shape_impl_t> m_impl;
};
#endif

View File

@@ -1,49 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Walt Disney Studios
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Nicola Candussi <nicola@fluidinteractive.com>
*/
//collision_shape_impl.h
#ifndef DYN_COLLISION_SHAPE_IMPL_H
#define DYN_COLLISION_SHAPE_IMPL_H
#include "shared_ptr.h"
#include "mathUtils.h"
class collision_shape_impl_t
{
public:
//
virtual void gl_draw(size_t draw_style) = 0;
virtual void set_scale(vec3f const& s) = 0;
virtual void get_scale(vec3f& s) = 0;
virtual float volume() = 0;
virtual vec3f const& local_inertia() = 0;
virtual vec3f const& center() = 0;
virtual quatf const& rotation() = 0;
public:
virtual ~collision_shape_impl_t() {};
};
#endif

View File

@@ -1,59 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Walt Disney Studios
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Nicola Candussi <nicola@fluidinteractive.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/
//bt_constraint.h
#ifndef DYN_BT_CONSTRAINT_H
#define DYN_BT_CONSTRAINT_H
#include "btBulletCollisionCommon.h"
#include "btBulletDynamicsCommon.h"
#include "shared_ptr.h"
class rigid_body_impl_t;
class bt_constraint_t
{
public:
protected:
friend class bt_solver_t;
bt_constraint_t() { }
btTypedConstraint* constraint() { return m_constraint.get(); }
void set_constraint(btTypedConstraint *constraint) { return m_constraint.reset(constraint); }
virtual void update_constraint(rigid_body_impl_t* rb) = 0;
public:
friend class bt_rigid_body_t;
virtual ~bt_constraint_t() { }
protected:
shared_ptr<btTypedConstraint> m_constraint;
};
#endif

View File

@@ -1,193 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Herbert Law
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Herbert Law <Herbert.Law@gmail.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/
//bt_hinge_constraint.h
#ifndef DYN_BT_HINGE_CONSTRAINT_H
#define DYN_BT_HINGE_CONSTRAINT_H
#include "bt_rigid_body.h"
#include "bt_constraint.h"
#include "hinge_constraint_impl.h"
class bt_hinge_constraint_t: public bt_constraint_t, public hinge_constraint_impl_t {
public:
virtual void set_damping(float d) {
// btHingeConstraint* p2pc = static_cast<btHingeConstraint*>(m_constraint.get());
// p2pc->m_setting.m_damping = d;
}
virtual void set_limit(float lower, float upper, float softness, float bias_factor, float relaxation_factor) {
btHingeConstraint* hinge = static_cast<btHingeConstraint*>(m_constraint.get());
hinge->setLimit(lower, upper, softness, bias_factor, relaxation_factor);
}
virtual void set_axis(vec3f const &p) {
btHingeConstraint* hinge = static_cast<btHingeConstraint*>(m_constraint.get());
btVector3 axis(p[0], p[1], p[2]);
hinge->setAxis(axis);
}
virtual float damping() const {
// btHingeConstraint const* hc = static_cast<btHingeConstraint const*>(m_constraint.get());
// return hc->m_setting.m_damping;
return 0;
}
//
virtual void get_frameA(vec3f& p, quatf& r) const
{
btHingeConstraint const* hc = static_cast<btHingeConstraint const*>(m_constraint.get());
const btTransform& btxform = hc->getAFrame();
btQuaternion bq = btxform.getRotation();
btVector3 bp = btxform.getOrigin();
p = vec3f(bp.x(), bp.y(), bp.z());
r = quatf(bq.w(), bq.x(), bq.y(), bq.z());
}
virtual void get_frameB(vec3f& p, quatf& r) const
{
btHingeConstraint const* hc = static_cast<btHingeConstraint const*>(m_constraint.get());
const btTransform& btxform = hc->getBFrame();
btQuaternion bq = btxform.getRotation();
btVector3 bp = btxform.getOrigin();
p = vec3f(bp.x(), bp.y(), bp.z());
r = quatf(bq.w(), bq.x(), bq.y(), bq.z());
}
virtual void get_invFrameA(vec3f& p, quatf& r) const
{
btHingeConstraint const* hc = static_cast<btHingeConstraint const*>(m_constraint.get());
const btTransform btxform = hc->getAFrame().inverse();
btQuaternion bq = btxform.getRotation();
btVector3 bp = btxform.getOrigin();
p = vec3f(bp.x(), bp.y(), bp.z());
r = quatf(bq.w(), bq.x(), bq.y(), bq.z());
}
virtual void get_invFrameB(vec3f& p, quatf& r) const
{
btHingeConstraint const* hc = static_cast<btHingeConstraint const*>(m_constraint.get());
const btTransform btxform = hc->getBFrame().inverse();
btQuaternion bq = btxform.getRotation();
btVector3 bp = btxform.getOrigin();
p = vec3f(bp.x(), bp.y(), bp.z());
r = quatf(bq.w(), bq.x(), bq.y(), bq.z());
}
virtual void worldToA(vec3f& w, vec3f& p) const
{
btHingeConstraint const* hc = static_cast<btHingeConstraint const*>(m_constraint.get());
const btTransform w2a = (hc->getRigidBodyA().getWorldTransform() * hc->getAFrame()).inverse();
btVector3 bw(w[0], w[1], w[2]);
btVector3 bp = w2a * bw;
p = vec3f(bp[0], bp[1], bp[2]);
}
virtual void worldFromB(vec3f& p, vec3f& w) const
{
btHingeConstraint const* hc = static_cast<btHingeConstraint const*>(m_constraint.get());
const btTransform b2w = hc->getRigidBodyB().getWorldTransform() * hc->getBFrame();
btVector3 bp(p[0], p[1], p[2]);
btVector3 bw = b2w * bp;
w = vec3f(bw[0], bw[1], bw[2]);
}
virtual void set_world(vec3f const &p, quatf const& r) {
btHingeConstraint* hc = static_cast<btHingeConstraint*>(m_constraint.get());
btVector3 worldP(p[0], p[1], p[2]);
btQuaternion worldR(r[1], r[2], r[3], r[0]);
btTransform frameAinW(worldR, worldP);
btTransform frameA = hc->getRigidBodyA().getWorldTransform().inverse() * frameAinW;
btTransform frameB = hc->getRigidBodyB().getWorldTransform().inverse() * frameAinW;
hc->getAFrame() = frameA;
hc->getBFrame() = frameB;
}
virtual void get_world(vec3f &p, quatf& r) const {
btHingeConstraint const* hc = static_cast<btHingeConstraint const*>(m_constraint.get());
btTransform frameAinW = hc->getRigidBodyA().getWorldTransform() * hc->getAFrame();
btQuaternion bq = frameAinW.getRotation();
btVector3 bp = frameAinW.getOrigin();
p = vec3f(bp.x(), bp.y(), bp.z());
r = quatf(bq.w(), bq.x(), bq.y(), bq.z());
}
virtual void enable_motor(bool enable, float velocity, float impulse) {
btHingeConstraint* hinge = static_cast<btHingeConstraint*>(m_constraint.get());
hinge->enableAngularMotor(enable, velocity, impulse);
}
virtual void update_constraint(rigid_body_impl_t* rb)
{
btHingeConstraint* hc = static_cast<btHingeConstraint*>(m_constraint.get());
btRigidBody* bt_body = static_cast<bt_rigid_body_t*>(rb)->body();
btTransform frameW, frameL;
if(bt_body == &hc->getRigidBodyA())
{
frameW = hc->getRigidBodyB().getWorldTransform() * hc->getBFrame();
frameL = hc->getRigidBodyA().getWorldTransform().inverse() * frameW;
hc->getAFrame() = frameL;
}
else if(bt_body == &hc->getRigidBodyB())
{
frameW = hc->getRigidBodyA().getWorldTransform() * hc->getAFrame();
frameL = hc->getRigidBodyB().getWorldTransform().inverse() * frameW;
hc->getBFrame() = frameL;
}
setPivotChanged(true);
}
protected:
friend class bt_solver_t;
bt_hinge_constraint_t(rigid_body_impl_t* rb, vec3f const& pivot, quatf const& rot):
hinge_constraint_impl_t()
{
btRigidBody& bt_body = *static_cast<bt_rigid_body_t*>(rb)->body();
btVector3 p(pivot[0], pivot[1], pivot[2]);
btQuaternion q(rot[1], rot[2], rot[3], rot[0]);
btTransform frameInA(q, p);
btHingeConstraint* hinge = new btHingeConstraint(bt_body, frameInA, false);
m_constraint.reset(hinge);
rb->add_constraint(this);
}
bt_hinge_constraint_t(rigid_body_impl_t* rbA, vec3f const& pivotA, quatf const& rotA, rigid_body_impl_t* rbB, vec3f const& pivotB, quatf const& rotB):
hinge_constraint_impl_t()
{
btRigidBody& bt_bodyA = *static_cast<bt_rigid_body_t*>(rbA)->body();
btRigidBody& bt_bodyB = *static_cast<bt_rigid_body_t*>(rbB)->body();
btVector3 pA(pivotA[0], pivotA[1], pivotA[2]);
btQuaternion qA(rotA[1], rotA[2], rotA[3], rotA[0]);
btTransform frameInA(qA, pA);
btVector3 pB(pivotB[0], pivotB[1], pivotB[2]);
btQuaternion qB(rotB[1], rotB[2], rotB[3], rotB[0]);
btTransform frameInB(qB, pB);
btHingeConstraint* hinge = new btHingeConstraint(bt_bodyA, bt_bodyB, frameInA, frameInB, false);
m_constraint.reset(hinge);
rbA->add_constraint(this);
rbB->add_constraint(this);
}
private:
};
#endif //DYN_BT_HINGE_CONSTRAINT_H

View File

@@ -1,160 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Walt Disney Studios
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Nicola Candussi <nicola@fluidinteractive.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/
//bt_nail_constraint.h
#ifndef DYN_BT_NAIL_CONSTRAINT_H
#define DYN_BT_NAIL_CONSTRAINT_H
#include "bt_rigid_body.h"
#include "bt_constraint.h"
#include "nail_constraint_impl.h"
class bt_nail_constraint_t: public bt_constraint_t, public nail_constraint_impl_t {
public:
virtual void set_damping(float d) {
btPoint2PointConstraint* p2pc = static_cast<btPoint2PointConstraint*>(m_constraint.get());
p2pc->m_setting.m_damping = d;
}
virtual float damping() const {
btPoint2PointConstraint const* p2pc = static_cast<btPoint2PointConstraint const*>(m_constraint.get());
return p2pc->m_setting.m_damping;
}
//
virtual void set_pivotA(vec3f const &p) {
btPoint2PointConstraint* p2pc = static_cast<btPoint2PointConstraint*>(m_constraint.get());
btVector3 bt_pivot(p[0], p[1], p[2]);
p2pc->setPivotA(bt_pivot);
setPivotChanged(true);
}
virtual void get_pivotA(vec3f &p) const {
btPoint2PointConstraint const* p2pc = static_cast<btPoint2PointConstraint const*>(m_constraint.get());
p[0] = p2pc->getPivotInA().x();
p[1] = p2pc->getPivotInA().y();
p[2] = p2pc->getPivotInA().z();
}
virtual void set_pivotB(vec3f const &p) {
btPoint2PointConstraint* p2pc = static_cast<btPoint2PointConstraint*>(m_constraint.get());
btVector3 bt_pivot(p[0], p[1], p[2]);
p2pc->setPivotB(bt_pivot);
setPivotChanged(true);
}
virtual void get_pivotB(vec3f &p) const {
btPoint2PointConstraint const* p2pc = static_cast<btPoint2PointConstraint const*>(m_constraint.get());
p[0] = p2pc->getPivotInB().x();
p[1] = p2pc->getPivotInB().y();
p[2] = p2pc->getPivotInB().z();
}
virtual void get_world_pivotA(vec3f &p) const {
btPoint2PointConstraint const* p2pc = static_cast<btPoint2PointConstraint const*>(m_constraint.get());
btVector3 pivotAinW = p2pc->getRigidBodyA().getCenterOfMassTransform()* p2pc->getPivotInA();
p[0] = pivotAinW.x();
p[1] = pivotAinW.y();
p[2] = pivotAinW.z();
}
virtual void get_world_pivotB(vec3f &p) const {
btPoint2PointConstraint const* p2pc = static_cast<btPoint2PointConstraint const*>(m_constraint.get());
btVector3 pivotBinW = p2pc->getRigidBodyB().getCenterOfMassTransform()* p2pc->getPivotInB();
p[0] = pivotBinW.x();
p[1] = pivotBinW.y();
p[2] = pivotBinW.z();
}
virtual void set_world(vec3f const &p) {
btPoint2PointConstraint* p2pc = static_cast<btPoint2PointConstraint*>(m_constraint.get());
btVector3 world(p[0], p[1], p[2]);
btVector3 pivotA = p2pc->getRigidBodyA().getWorldTransform().inverse() (world);
p2pc->setPivotA(pivotA);
btVector3 pivotB = p2pc->getRigidBodyB().getWorldTransform().inverse() (world);
p2pc->setPivotB(pivotB);
setPivotChanged(true);
}
virtual void get_world(vec3f &p) const {
btPoint2PointConstraint const* p2pc = static_cast<btPoint2PointConstraint const*>(m_constraint.get());
btVector3 pivotAinW = p2pc->getRigidBodyA().getCenterOfMassTransform()* p2pc->getPivotInA();
p[0] = pivotAinW.x();
p[1] = pivotAinW.y();
p[2] = pivotAinW.z();
}
virtual void update_constraint(rigid_body_impl_t* rb)
{
btRigidBody* bt_body = static_cast<bt_rigid_body_t*>(rb)->body();
btPoint2PointConstraint* p2pc = static_cast<btPoint2PointConstraint*>(m_constraint.get());
btVector3 world, pivot;
if(bt_body == &p2pc->getRigidBodyA())
{
world = p2pc->getRigidBodyB().getWorldTransform() * p2pc->getPivotInB();
pivot = p2pc->getRigidBodyA().getWorldTransform().inverse() * world;
p2pc->setPivotA(pivot);
}
else if(bt_body == &p2pc->getRigidBodyB())
{
world = p2pc->getRigidBodyA().getWorldTransform() * p2pc->getPivotInA();
pivot = p2pc->getRigidBodyB().getWorldTransform().inverse() * world;
p2pc->setPivotB(pivot);
}
else
{
world.setValue(0.f, 0.f, 0.f);
}
setPivotChanged(true);
}
protected:
friend class bt_solver_t;
bt_nail_constraint_t(rigid_body_impl_t* rb, vec3f const& pivot):
nail_constraint_impl_t()
{
btVector3 bulPivot(pivot[0], pivot[1], pivot[2]);
btRigidBody& bt_body = *static_cast<bt_rigid_body_t*>(rb)->body();
m_constraint.reset(new btPoint2PointConstraint(bt_body, bulPivot));
rb->add_constraint(this);
}
bt_nail_constraint_t(rigid_body_impl_t* rbA, rigid_body_impl_t* rbB, vec3f const& pivotInA, vec3f const& pivotInB):
nail_constraint_impl_t()
{
btRigidBody& bt_bodyA = *static_cast<bt_rigid_body_t*>(rbA)->body();
btRigidBody& bt_bodyB = *static_cast<bt_rigid_body_t*>(rbB)->body();
btVector3 bulPivotInA(pivotInA[0], pivotInA[1], pivotInA[2]);
btVector3 bulPivotInB(pivotInB[0], pivotInB[1], pivotInB[2]);
m_constraint.reset(new btPoint2PointConstraint(bt_bodyA, bt_bodyB, bulPivotInA, bulPivotInB));
rbA->add_constraint(this);
rbB->add_constraint(this);
}
private:
};
#endif

View File

@@ -1,195 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Herbert Law
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Herbert Law <Herbert.Law@gmail.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/
//bt_sixdof_constraint.h
#ifndef DYN_BT_SIXDOF_CONSTRAINT_H
#define DYN_BT_SIXDOF_CONSTRAINT_H
#include "bt_rigid_body.h"
#include "bt_constraint.h"
#include "sixdof_constraint_impl.h"
class bt_sixdof_constraint_t: public bt_constraint_t, public sixdof_constraint_impl_t {
public:
virtual void set_damping(float d) {
// btGeneric6DofConstraint* p2pc = static_cast<btGeneric6DofConstraint*>(m_constraint.get());
// p2pc->m_setting.m_damping = d;
}
virtual void set_LinLimit(vec3f& lower, vec3f& upper) {
btGeneric6DofConstraint* sixdof = static_cast<btGeneric6DofConstraint*>(m_constraint.get());
btVector3 btlow(lower[0], lower[1], lower[2]);
btVector3 btupp(upper[0], upper[1], upper[2]);
sixdof->setLinearLowerLimit(btlow);
sixdof->setLinearUpperLimit(btupp);
}
virtual void set_AngLimit(vec3f& lower, vec3f& upper) {
btGeneric6DofConstraint* sixdof = static_cast<btGeneric6DofConstraint*>(m_constraint.get());
btVector3 btlow(lower[0], lower[1], lower[2]);
btVector3 btupp(upper[0], upper[1], upper[2]);
sixdof->setAngularLowerLimit(btlow);
sixdof->setAngularUpperLimit(btupp);
}
virtual float damping() const {
// btGeneric6DofConstraint const* hc = static_cast<btGeneric6DofConstraint const*>(m_constraint.get());
// return hc->m_setting.m_damping;
return 0;
}
virtual void get_frameA(vec3f& p, quatf& r) const
{
btGeneric6DofConstraint const* sc = static_cast<btGeneric6DofConstraint const*>(m_constraint.get());
const btTransform& btxform = sc->getFrameOffsetA();
btQuaternion bq = btxform.getRotation();
btVector3 bp = btxform.getOrigin();
p = vec3f(bp.x(), bp.y(), bp.z());
r = quatf(bq.w(), bq.x(), bq.y(), bq.z());
}
virtual void get_frameB(vec3f& p, quatf& r) const
{
btGeneric6DofConstraint const* sc = static_cast<btGeneric6DofConstraint const*>(m_constraint.get());
const btTransform& btxform = sc->getFrameOffsetB();
btQuaternion bq = btxform.getRotation();
btVector3 bp = btxform.getOrigin();
p = vec3f(bp.x(), bp.y(), bp.z());
r = quatf(bq.w(), bq.x(), bq.y(), bq.z());
}
virtual void get_invFrameA(vec3f& p, quatf& r) const
{
btGeneric6DofConstraint const* sc = static_cast<btGeneric6DofConstraint const*>(m_constraint.get());
const btTransform btxform = sc->getFrameOffsetA().inverse();
btQuaternion bq = btxform.getRotation();
btVector3 bp = btxform.getOrigin();
p = vec3f(bp.x(), bp.y(), bp.z());
r = quatf(bq.w(), bq.x(), bq.y(), bq.z());
}
virtual void get_invFrameB(vec3f& p, quatf& r) const
{
btGeneric6DofConstraint const* sc = static_cast<btGeneric6DofConstraint const*>(m_constraint.get());
const btTransform btxform = sc->getFrameOffsetB().inverse();
btQuaternion bq = btxform.getRotation();
btVector3 bp = btxform.getOrigin();
p = vec3f(bp.x(), bp.y(), bp.z());
r = quatf(bq.w(), bq.x(), bq.y(), bq.z());
}
virtual void worldToA(vec3f& w, vec3f& p) const
{
btGeneric6DofConstraint const* sc = static_cast<btGeneric6DofConstraint const*>(m_constraint.get());
const btTransform w2a = (sc->getRigidBodyA().getWorldTransform() * sc->getFrameOffsetA()).inverse();
btVector3 bw(w[0], w[1], w[2]);
btVector3 bp = w2a * bw;
p = vec3f(bp[0], bp[1], bp[2]);
}
virtual void worldFromB(vec3f& p, vec3f& w) const
{
btGeneric6DofConstraint const* sc = static_cast<btGeneric6DofConstraint const*>(m_constraint.get());
const btTransform b2w = sc->getRigidBodyB().getWorldTransform() * sc->getFrameOffsetB();
btVector3 bp(p[0], p[1], p[2]);
btVector3 bw = b2w * bp;
w = vec3f(bw[0], bw[1], bw[2]);
}
virtual void set_world(vec3f const &p, quatf const& r) {
btGeneric6DofConstraint* sc = static_cast<btGeneric6DofConstraint*>(m_constraint.get());
btVector3 worldP(p[0], p[1], p[2]);
btQuaternion worldR(r[1], r[2], r[3], r[0]);
btTransform frameAinW(worldR, worldP);
btTransform frameA = sc->getRigidBodyA().getWorldTransform().inverse() * frameAinW;
btTransform frameB = sc->getRigidBodyB().getWorldTransform().inverse() * frameAinW;
sc->getFrameOffsetA() = frameA;
sc->getFrameOffsetB() = frameB;
}
virtual void get_world(vec3f &p, quatf& r) const {
btGeneric6DofConstraint const* sc = static_cast<btGeneric6DofConstraint const*>(m_constraint.get());
btTransform frameAinW = sc->getRigidBodyA().getWorldTransform() * sc->getFrameOffsetA();
btQuaternion bq = frameAinW.getRotation();
btVector3 bp = frameAinW.getOrigin();
p = vec3f(bp.x(), bp.y(), bp.z());
r = quatf(bq.w(), bq.x(), bq.y(), bq.z());
}
virtual void update_constraint(rigid_body_impl_t* rb)
{
btGeneric6DofConstraint* sc = static_cast<btGeneric6DofConstraint*>(m_constraint.get());
btRigidBody* bt_body = static_cast<bt_rigid_body_t*>(rb)->body();
btTransform frameW, frameL;
if(bt_body == &sc->getRigidBodyA())
{
frameW = sc->getRigidBodyB().getWorldTransform() * sc->getFrameOffsetB();
frameL = sc->getRigidBodyA().getWorldTransform().inverse() * frameW;
sc->getFrameOffsetA() = frameL;
}
else if(bt_body == &sc->getRigidBodyB())
{
frameW = sc->getRigidBodyA().getWorldTransform() * sc->getFrameOffsetA();
frameL = sc->getRigidBodyB().getWorldTransform().inverse() * frameW;
sc->getFrameOffsetB() = frameL;
}
setPivotChanged(true);
}
protected:
friend class bt_solver_t;
bt_sixdof_constraint_t(rigid_body_impl_t* rb, vec3f const& pivot, quatf const& rot):
sixdof_constraint_impl_t()
{
btRigidBody& bt_body = *static_cast<bt_rigid_body_t*>(rb)->body();
btVector3 p(pivot[0], pivot[1], pivot[2]);
btQuaternion q(rot[1], rot[2], rot[3], rot[0]);
btTransform frameInA(q, p);
btGeneric6DofConstraint* sixdof = new btGeneric6DofConstraint(bt_body, frameInA, false);
m_constraint.reset(sixdof);
rb->add_constraint(this);
}
bt_sixdof_constraint_t(rigid_body_impl_t* rbA, vec3f const& pivotA, quatf const& rotA, rigid_body_impl_t* rbB, vec3f const& pivotB, quatf const& rotB):
sixdof_constraint_impl_t()
{
btRigidBody& bt_bodyA = *static_cast<bt_rigid_body_t*>(rbA)->body();
btRigidBody& bt_bodyB = *static_cast<bt_rigid_body_t*>(rbB)->body();
btVector3 pA(pivotA[0], pivotA[1], pivotA[2]);
btQuaternion qA(rotA[1], rotA[2], rotA[3], rotA[0]);
btTransform frameInA(qA, pA);
btVector3 pB(pivotB[0], pivotB[1], pivotB[2]);
btQuaternion qB(rotB[1], rotB[2], rotB[3], rotB[0]);
btTransform frameInB(qB, pB);
btGeneric6DofConstraint* sixdof = new btGeneric6DofConstraint(bt_bodyA, bt_bodyB, frameInA, frameInB, false);
m_constraint.reset(sixdof);
rbA->add_constraint(this);
rbB->add_constraint(this);
}
private:
};
#endif //DYN_BT_SIXDOF_CONSTRAINT_H

View File

@@ -1,190 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Herbert Law
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Herbert Law <Herbert.Law@gmail.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/
//bt_slider_constraint.h
#ifndef DYN_BT_SLIDER_CONSTRAINT_H
#define DYN_BT_SLIDER_CONSTRAINT_H
#include "bt_rigid_body.h"
#include "bt_constraint.h"
#include "slider_constraint_impl.h"
class bt_slider_constraint_t: public bt_constraint_t, public slider_constraint_impl_t {
public:
virtual void set_damping(float d) {
// btSliderConstraint* p2pc = static_cast<btSliderConstraint*>(m_constraint.get());
// p2pc->m_setting.m_damping = d;
}
virtual void set_LinLimit(float lower, float upper) {
btSliderConstraint* slider = static_cast<btSliderConstraint*>(m_constraint.get());
slider->setLowerLinLimit(lower);
slider->setUpperLinLimit(upper);
}
virtual void set_AngLimit(float lower, float upper) {
btSliderConstraint* slider = static_cast<btSliderConstraint*>(m_constraint.get());
slider->setLowerAngLimit(lower);
slider->setUpperAngLimit(upper);
}
virtual float damping() const {
// btSliderConstraint const* hc = static_cast<btSliderConstraint const*>(m_constraint.get());
// return hc->m_setting.m_damping;
return 0;
}
virtual void get_frameA(vec3f& p, quatf& r) const
{
btSliderConstraint const* sc = static_cast<btSliderConstraint const*>(m_constraint.get());
const btTransform& btxform = sc->getFrameOffsetA();
btQuaternion bq = btxform.getRotation();
btVector3 bp = btxform.getOrigin();
p = vec3f(bp.x(), bp.y(), bp.z());
r = quatf(bq.w(), bq.x(), bq.y(), bq.z());
}
virtual void get_frameB(vec3f& p, quatf& r) const
{
btSliderConstraint const* sc = static_cast<btSliderConstraint const*>(m_constraint.get());
const btTransform& btxform = sc->getFrameOffsetB();
btQuaternion bq = btxform.getRotation();
btVector3 bp = btxform.getOrigin();
p = vec3f(bp.x(), bp.y(), bp.z());
r = quatf(bq.w(), bq.x(), bq.y(), bq.z());
}
virtual void get_invFrameA(vec3f& p, quatf& r) const
{
btSliderConstraint const* sc = static_cast<btSliderConstraint const*>(m_constraint.get());
const btTransform btxform = sc->getFrameOffsetA().inverse();
btQuaternion bq = btxform.getRotation();
btVector3 bp = btxform.getOrigin();
p = vec3f(bp.x(), bp.y(), bp.z());
r = quatf(bq.w(), bq.x(), bq.y(), bq.z());
}
virtual void get_invFrameB(vec3f& p, quatf& r) const
{
btSliderConstraint const* sc = static_cast<btSliderConstraint const*>(m_constraint.get());
const btTransform btxform = sc->getFrameOffsetB().inverse();
btQuaternion bq = btxform.getRotation();
btVector3 bp = btxform.getOrigin();
p = vec3f(bp.x(), bp.y(), bp.z());
r = quatf(bq.w(), bq.x(), bq.y(), bq.z());
}
virtual void worldToA(vec3f& w, vec3f& p) const
{
btSliderConstraint const* sc = static_cast<btSliderConstraint const*>(m_constraint.get());
const btTransform w2a = (sc->getRigidBodyA().getWorldTransform() * sc->getFrameOffsetA()).inverse();
btVector3 bw(w[0], w[1], w[2]);
btVector3 bp = w2a * bw;
p = vec3f(bp[0], bp[1], bp[2]);
}
virtual void worldFromB(vec3f& p, vec3f& w) const
{
btSliderConstraint const* sc = static_cast<btSliderConstraint const*>(m_constraint.get());
const btTransform b2w = sc->getRigidBodyB().getWorldTransform() * sc->getFrameOffsetB();
btVector3 bp(p[0], p[1], p[2]);
btVector3 bw = b2w * bp;
w = vec3f(bw[0], bw[1], bw[2]);
}
virtual void set_world(vec3f const &p, quatf const& r) {
btSliderConstraint* sc = static_cast<btSliderConstraint*>(m_constraint.get());
btVector3 worldP(p[0], p[1], p[2]);
btQuaternion worldR(r[1], r[2], r[3], r[0]);
btTransform frameAinW(worldR, worldP);
btTransform frameA = sc->getRigidBodyA().getWorldTransform().inverse() * frameAinW;
btTransform frameB = sc->getRigidBodyB().getWorldTransform().inverse() * frameAinW;
sc->getFrameOffsetA() = frameA;
sc->getFrameOffsetB() = frameB;
}
virtual void get_world(vec3f &p, quatf& r) const {
btSliderConstraint const* sc = static_cast<btSliderConstraint const*>(m_constraint.get());
btTransform frameAinW = sc->getRigidBodyA().getWorldTransform() * sc->getFrameOffsetA();
btQuaternion bq = frameAinW.getRotation();
btVector3 bp = frameAinW.getOrigin();
p = vec3f(bp.x(), bp.y(), bp.z());
r = quatf(bq.w(), bq.x(), bq.y(), bq.z());
}
virtual void update_constraint(rigid_body_impl_t* rb)
{
btSliderConstraint* sc = static_cast<btSliderConstraint*>(m_constraint.get());
btRigidBody* bt_body = static_cast<bt_rigid_body_t*>(rb)->body();
btTransform frameW, frameL;
if(bt_body == &sc->getRigidBodyA())
{
frameW = sc->getRigidBodyB().getWorldTransform() * sc->getFrameOffsetB();
frameL = sc->getRigidBodyA().getWorldTransform().inverse() * frameW;
sc->getFrameOffsetA() = frameL;
}
else if(bt_body == &sc->getRigidBodyB())
{
frameW = sc->getRigidBodyA().getWorldTransform() * sc->getFrameOffsetA();
frameL = sc->getRigidBodyB().getWorldTransform().inverse() * frameW;
sc->getFrameOffsetB() = frameL;
}
setPivotChanged(true);
}
protected:
friend class bt_solver_t;
bt_slider_constraint_t(rigid_body_impl_t* rb, vec3f const& pivot, quatf const& rot):
slider_constraint_impl_t()
{
btRigidBody& bt_body = *static_cast<bt_rigid_body_t*>(rb)->body();
btVector3 p(pivot[0], pivot[1], pivot[2]);
btQuaternion q(rot[1], rot[2], rot[3], rot[0]);
btTransform frameInA(q, p);
btSliderConstraint* slider = new btSliderConstraint(bt_body, frameInA, false);
m_constraint.reset(slider);
rb->add_constraint(this);
}
bt_slider_constraint_t(rigid_body_impl_t* rbA, vec3f const& pivotA, quatf const& rotA, rigid_body_impl_t* rbB, vec3f const& pivotB, quatf const& rotB):
slider_constraint_impl_t()
{
btRigidBody& bt_bodyA = *static_cast<bt_rigid_body_t*>(rbA)->body();
btRigidBody& bt_bodyB = *static_cast<bt_rigid_body_t*>(rbB)->body();
btVector3 pA(pivotA[0], pivotA[1], pivotA[2]);
btQuaternion qA(rotA[1], rotA[2], rotA[3], rotA[0]);
btTransform frameInA(qA, pA);
btVector3 pB(pivotB[0], pivotB[1], pivotB[2]);
btQuaternion qB(rotB[1], rotB[2], rotB[3], rotB[0]);
btTransform frameInB(qB, pB);
btSliderConstraint* slider = new btSliderConstraint(bt_bodyA, bt_bodyB, frameInA, frameInB, false);
m_constraint.reset(slider);
rbA->add_constraint(this);
rbB->add_constraint(this);
}
private:
};
#endif //DYN_BT_SLIDER_CONSTRAINT_H

View File

@@ -1,67 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Walt Disney Studios
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Nicola Candussi <nicola@fluidinteractive.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/
//constraint.h
#ifndef DYN_CONSTRAINT_H
#define DYN_CONSTRAINT_H
#include "shared_ptr.h"
#include "constraint_impl.h"
class constraint_t
{
public:
//typedefs
typedef shared_ptr<constraint_t> pointer;
public:
virtual ~constraint_t() {}
bool getPivotChanged()
{
constraint_impl_t* constr_impl = dynamic_cast<constraint_impl_t*>(impl());
return constr_impl->getPivotChanged();
}
void setPivotChanged(bool isChanged)
{
constraint_impl_t* constr_impl = dynamic_cast<constraint_impl_t*>(impl());
return constr_impl->setPivotChanged(isChanged);
}
constraint_impl_t* pubImpl() { return m_impl.get(); }
protected:
friend class solver_t;
constraint_t(constraint_impl_t* impl): m_impl(impl) { }
constraint_impl_t* impl() { return m_impl.get(); }
constraint_impl_t const* impl() const { return m_impl.get(); }
protected:
shared_ptr<constraint_impl_t> m_impl;
};
#endif

View File

@@ -1,44 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Walt Disney Studios
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Nicola Candussi <nicola@fluidinteractive.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/
//constraint_impl.h
#ifndef DYN_CONSTRAINT_IMPL_H
#define DYN_CONSTRAINT_IMPL_H
class constraint_impl_t
{
public:
//
public:
virtual ~constraint_impl_t() {};
bool getPivotChanged() { return m_pivotChanged; }
void setPivotChanged(bool isChanged) { m_pivotChanged = isChanged; }
protected:
bool m_pivotChanged;
};
#endif

View File

@@ -1,133 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Herbert Law
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Herbert Law <Herbert.Law@gmail.com>
*/
//dHingeConstraintCmd.cpp
#include <maya/MGlobal.h>
#include <maya/MItDependencyNodes.h>
#include <maya/MSyntax.h>
#include "hingeConstraintNode.h"
#include "dHingeConstraintCmd.h"
MString dHingeConstraintCmd::typeName("dHingeConstraint");
dHingeConstraintCmd::dHingeConstraintCmd()
: m_argDatabase(0),
m_dagModifier(0)
{
}
dHingeConstraintCmd::~dHingeConstraintCmd()
{
if (m_argDatabase) {
delete m_argDatabase;
}
if (m_dagModifier) {
delete m_dagModifier;
}
}
void *
dHingeConstraintCmd::creator()
{
return new dHingeConstraintCmd;
}
MSyntax
dHingeConstraintCmd::syntax()
{
MSyntax syntax;
syntax.enableQuery(false);
syntax.enableEdit(false);
syntax.addFlag("-n", "-name", MSyntax::kString);
// syntax.addFlag("-fn", "-filename", MSyntax::kString);
// syntax.addFlag("-col", "-color", MSyntax::kString);
// syntax.addFlag("-dia", "-diameter", MSyntax::kDouble);
return syntax;
}
MStatus
dHingeConstraintCmd::doIt(const MArgList &args)
{
MStatus stat;
m_argDatabase = new MArgDatabase(syntax(), args, &stat);
if (stat == MS::kFailure) {
return stat;
}
return redoIt();
}
MStatus
dHingeConstraintCmd::undoIt()
{
MGlobal::setActiveSelectionList(m_undoSelectionList);
if (m_dagModifier) {
m_dagModifier->undoIt();
delete m_dagModifier;
m_dagModifier = 0;
}
return MS::kSuccess;
}
MStatus
dHingeConstraintCmd::redoIt()
{
MGlobal::getActiveSelectionList(m_undoSelectionList);
MString name;
if (m_argDatabase->isFlagSet("-name")) {
m_argDatabase->getFlagArgument("-name", 0, name);
}
if (!name.length()) {
name = "dHingeConstraint";
}
m_dagModifier = new MDagModifier;
MObject parentObj = m_dagModifier->createNode("transform");
m_dagModifier->renameNode(parentObj, name + "#");
m_dagModifier->doIt();
MObject dConstraintObj = m_dagModifier->createNode(hingeConstraintNode::typeId, parentObj);
std::string dConstraintName = MFnDependencyNode(parentObj).name().asChar();
std::string::size_type pos = dConstraintName.find_last_not_of("0123456789");
dConstraintName.insert(pos + 1, "Shape");
m_dagModifier->renameNode(dConstraintObj, dConstraintName.c_str());
m_dagModifier->doIt();
setResult(MFnDependencyNode(dConstraintObj).name());
return MS::kSuccess;
}

View File

@@ -1,58 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Herbert Law
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Herbert Law <Herbert.Law@gmail.com>
*/
//dHingeConstraintCmd.h
#ifndef DYN_HINGE_CONSTRAINT_CMD_H
#define DYN_HINGE_CONSTRAINT_CMD_H
#include <maya/MArgDatabase.h>
#include <maya/MDagModifier.h>
#include <maya/MSelectionList.h>
#include <maya/MPxCommand.h>
class dHingeConstraintCmd : public MPxCommand
{
public:
dHingeConstraintCmd();
virtual ~dHingeConstraintCmd();
static void *creator();
static MSyntax syntax();
MStatus doIt(const MArgList &i_mArgList);
MStatus redoIt();
MStatus undoIt();
bool isUndoable() const { return true; }
bool hasSyntax() const { return true; }
static MString typeName;
protected:
MArgDatabase *m_argDatabase;
MDagModifier *m_dagModifier;
MSelectionList m_undoSelectionList;
};
#endif //DYN_HINGE_CONSTRAINT_CMD_H

View File

@@ -1,133 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Herbert Law
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Nicola Candussi <nicola@fluidinteractive.com>
*/
//dNailConstraintCmd.cpp
#include <maya/MGlobal.h>
#include <maya/MItDependencyNodes.h>
#include <maya/MSyntax.h>
#include "nailConstraintNode.h"
#include "dNailConstraintCmd.h"
MString dNailConstraintCmd::typeName("dNailConstraint");
dNailConstraintCmd::dNailConstraintCmd()
: m_argDatabase(0),
m_dagModifier(0)
{
}
dNailConstraintCmd::~dNailConstraintCmd()
{
if (m_argDatabase) {
delete m_argDatabase;
}
if (m_dagModifier) {
delete m_dagModifier;
}
}
void *
dNailConstraintCmd::creator()
{
return new dNailConstraintCmd;
}
MSyntax
dNailConstraintCmd::syntax()
{
MSyntax syntax;
syntax.enableQuery(false);
syntax.enableEdit(false);
syntax.addFlag("-n", "-name", MSyntax::kString);
// syntax.addFlag("-fn", "-filename", MSyntax::kString);
// syntax.addFlag("-col", "-color", MSyntax::kString);
// syntax.addFlag("-dia", "-diameter", MSyntax::kDouble);
return syntax;
}
MStatus
dNailConstraintCmd::doIt(const MArgList &args)
{
MStatus stat;
m_argDatabase = new MArgDatabase(syntax(), args, &stat);
if (stat == MS::kFailure) {
return stat;
}
return redoIt();
}
MStatus
dNailConstraintCmd::undoIt()
{
MGlobal::setActiveSelectionList(m_undoSelectionList);
if (m_dagModifier) {
m_dagModifier->undoIt();
delete m_dagModifier;
m_dagModifier = 0;
}
return MS::kSuccess;
}
MStatus
dNailConstraintCmd::redoIt()
{
MGlobal::getActiveSelectionList(m_undoSelectionList);
MString name;
if (m_argDatabase->isFlagSet("-name")) {
m_argDatabase->getFlagArgument("-name", 0, name);
}
if (!name.length()) {
name = "dNailConstraint";
}
m_dagModifier = new MDagModifier;
MObject parentObj = m_dagModifier->createNode("transform");
m_dagModifier->renameNode(parentObj, name + "#");
m_dagModifier->doIt();
MObject dConstraintObj = m_dagModifier->createNode(nailConstraintNode::typeId, parentObj);
std::string dConstraintName = MFnDependencyNode(parentObj).name().asChar();
std::string::size_type pos = dConstraintName.find_last_not_of("0123456789");
dConstraintName.insert(pos + 1, "Shape");
m_dagModifier->renameNode(dConstraintObj, dConstraintName.c_str());
m_dagModifier->doIt();
setResult(MFnDependencyNode(dConstraintObj).name());
return MS::kSuccess;
}

View File

@@ -1,58 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Walt Disney Studios
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Nicola Candussi <nicola@fluidinteractive.com>
*/
//dNailConstraintCmd.h
#ifndef DYN_NAIL_CONSTRAINT_CMD_H
#define DYN_NAIL_CONSTRAINT_CMD_H
#include <maya/MArgDatabase.h>
#include <maya/MDagModifier.h>
#include <maya/MSelectionList.h>
#include <maya/MPxCommand.h>
class dNailConstraintCmd : public MPxCommand
{
public:
dNailConstraintCmd();
virtual ~dNailConstraintCmd();
static void *creator();
static MSyntax syntax();
MStatus doIt(const MArgList &i_mArgList);
MStatus redoIt();
MStatus undoIt();
bool isUndoable() const { return true; }
bool hasSyntax() const { return true; }
static MString typeName;
protected:
MArgDatabase *m_argDatabase;
MDagModifier *m_dagModifier;
MSelectionList m_undoSelectionList;
};
#endif

View File

@@ -1,133 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Herbert Law
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Herbert Law <Herbert.Law@gmail.com>
*/
//dSliderConstraintCmd.cpp
#include <maya/MGlobal.h>
#include <maya/MItDependencyNodes.h>
#include <maya/MSyntax.h>
#include "sliderConstraintNode.h"
#include "dSliderConstraintCmd.h"
MString dSliderConstraintCmd::typeName("dSliderConstraint");
dSliderConstraintCmd::dSliderConstraintCmd()
: m_argDatabase(0),
m_dagModifier(0)
{
}
dSliderConstraintCmd::~dSliderConstraintCmd()
{
if (m_argDatabase) {
delete m_argDatabase;
}
if (m_dagModifier) {
delete m_dagModifier;
}
}
void *
dSliderConstraintCmd::creator()
{
return new dSliderConstraintCmd;
}
MSyntax
dSliderConstraintCmd::syntax()
{
MSyntax syntax;
syntax.enableQuery(false);
syntax.enableEdit(false);
syntax.addFlag("-n", "-name", MSyntax::kString);
// syntax.addFlag("-fn", "-filename", MSyntax::kString);
// syntax.addFlag("-col", "-color", MSyntax::kString);
// syntax.addFlag("-dia", "-diameter", MSyntax::kDouble);
return syntax;
}
MStatus
dSliderConstraintCmd::doIt(const MArgList &args)
{
MStatus stat;
m_argDatabase = new MArgDatabase(syntax(), args, &stat);
if (stat == MS::kFailure) {
return stat;
}
return redoIt();
}
MStatus
dSliderConstraintCmd::undoIt()
{
MGlobal::setActiveSelectionList(m_undoSelectionList);
if (m_dagModifier) {
m_dagModifier->undoIt();
delete m_dagModifier;
m_dagModifier = 0;
}
return MS::kSuccess;
}
MStatus
dSliderConstraintCmd::redoIt()
{
MGlobal::getActiveSelectionList(m_undoSelectionList);
MString name;
if (m_argDatabase->isFlagSet("-name")) {
m_argDatabase->getFlagArgument("-name", 0, name);
}
if (!name.length()) {
name = "dSliderConstraint";
}
m_dagModifier = new MDagModifier;
MObject parentObj = m_dagModifier->createNode("transform");
m_dagModifier->renameNode(parentObj, name + "#");
m_dagModifier->doIt();
MObject dConstraintObj = m_dagModifier->createNode(sliderConstraintNode::typeId, parentObj);
std::string dConstraintName = MFnDependencyNode(parentObj).name().asChar();
std::string::size_type pos = dConstraintName.find_last_not_of("0123456789");
dConstraintName.insert(pos + 1, "Shape");
m_dagModifier->renameNode(dConstraintObj, dConstraintName.c_str());
m_dagModifier->doIt();
setResult(MFnDependencyNode(dConstraintObj).name());
return MS::kSuccess;
}

View File

@@ -1,58 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Herbert Law
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Herbert Law <Herbert.Law@gmail.com>
*/
//dSliderConstraintCmd.h
#ifndef DYN_SLIDER_CONSTRAINT_CMD_H
#define DYN_SLIDER_CONSTRAINT_CMD_H
#include <maya/MArgDatabase.h>
#include <maya/MDagModifier.h>
#include <maya/MSelectionList.h>
#include <maya/MPxCommand.h>
class dSliderConstraintCmd : public MPxCommand
{
public:
dSliderConstraintCmd();
virtual ~dSliderConstraintCmd();
static void *creator();
static MSyntax syntax();
MStatus doIt(const MArgList &i_mArgList);
MStatus redoIt();
MStatus undoIt();
bool isUndoable() const { return true; }
bool hasSyntax() const { return true; }
static MString typeName;
protected:
MArgDatabase *m_argDatabase;
MDagModifier *m_dagModifier;
MSelectionList m_undoSelectionList;
};
#endif //DYN_SLIDER_CONSTRAINT_CMD_H

View File

@@ -1,133 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Herbert Law
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Herbert Law <Herbert.Law@gmail.com>
*/
//dSixdofConstraintCmd.cpp
#include <maya/MGlobal.h>
#include <maya/MItDependencyNodes.h>
#include <maya/MSyntax.h>
#include "sixdofConstraintNode.h"
#include "dsixdofConstraintCmd.h"
MString dSixdofConstraintCmd::typeName("dSixdofConstraint");
dSixdofConstraintCmd::dSixdofConstraintCmd()
: m_argDatabase(0),
m_dagModifier(0)
{
}
dSixdofConstraintCmd::~dSixdofConstraintCmd()
{
if (m_argDatabase) {
delete m_argDatabase;
}
if (m_dagModifier) {
delete m_dagModifier;
}
}
void *
dSixdofConstraintCmd::creator()
{
return new dSixdofConstraintCmd;
}
MSyntax
dSixdofConstraintCmd::syntax()
{
MSyntax syntax;
syntax.enableQuery(false);
syntax.enableEdit(false);
syntax.addFlag("-n", "-name", MSyntax::kString);
// syntax.addFlag("-fn", "-filename", MSyntax::kString);
// syntax.addFlag("-col", "-color", MSyntax::kString);
// syntax.addFlag("-dia", "-diameter", MSyntax::kDouble);
return syntax;
}
MStatus
dSixdofConstraintCmd::doIt(const MArgList &args)
{
MStatus stat;
m_argDatabase = new MArgDatabase(syntax(), args, &stat);
if (stat == MS::kFailure) {
return stat;
}
return redoIt();
}
MStatus
dSixdofConstraintCmd::undoIt()
{
MGlobal::setActiveSelectionList(m_undoSelectionList);
if (m_dagModifier) {
m_dagModifier->undoIt();
delete m_dagModifier;
m_dagModifier = 0;
}
return MS::kSuccess;
}
MStatus
dSixdofConstraintCmd::redoIt()
{
MGlobal::getActiveSelectionList(m_undoSelectionList);
MString name;
if (m_argDatabase->isFlagSet("-name")) {
m_argDatabase->getFlagArgument("-name", 0, name);
}
if (!name.length()) {
name = "dSixdofConstraint";
}
m_dagModifier = new MDagModifier;
MObject parentObj = m_dagModifier->createNode("transform");
m_dagModifier->renameNode(parentObj, name + "#");
m_dagModifier->doIt();
MObject dConstraintObj = m_dagModifier->createNode(sixdofConstraintNode::typeId, parentObj);
std::string dConstraintName = MFnDependencyNode(parentObj).name().asChar();
std::string::size_type pos = dConstraintName.find_last_not_of("0123456789");
dConstraintName.insert(pos + 1, "Shape");
m_dagModifier->renameNode(dConstraintObj, dConstraintName.c_str());
m_dagModifier->doIt();
setResult(MFnDependencyNode(dConstraintObj).name());
return MS::kSuccess;
}

View File

@@ -1,58 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Herbert Law
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Herbert Law <Herbert.Law@gmail.com>
*/
//dSixdofConstraintCmd.h
#ifndef DYN_SIXDOF_CONSTRAINT_CMD_H
#define DYN_SIXDOF_CONSTRAINT_CMD_H
#include <maya/MArgDatabase.h>
#include <maya/MDagModifier.h>
#include <maya/MSelectionList.h>
#include <maya/MPxCommand.h>
class dSixdofConstraintCmd : public MPxCommand
{
public:
dSixdofConstraintCmd();
virtual ~dSixdofConstraintCmd();
static void *creator();
static MSyntax syntax();
MStatus doIt(const MArgList &i_mArgList);
MStatus redoIt();
MStatus undoIt();
bool isUndoable() const { return true; }
bool hasSyntax() const { return true; }
static MString typeName;
protected:
MArgDatabase *m_argDatabase;
MDagModifier *m_dagModifier;
MSelectionList m_undoSelectionList;
};
#endif //DYN_SIXDOF_CONSTRAINT_CMD_H

View File

@@ -1,685 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Herbert Law
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Herbert Law <Herbert.Law@gmail.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/
//hingeConstraintNode.cpp
#include <maya/MFnDependencyNode.h>
#include <maya/MPlugArray.h>
#include <maya/MFnMessageAttribute.h>
#include <maya/MFnNumericAttribute.h>
#include <maya/MFnMatrixAttribute.h>
#include <maya/MMatrix.h>
#include <maya/MFnMatrixData.h>
#include <maya/MFnTransform.h>
#include <maya/MQuaternion.h>
#include <maya/MEulerRotation.h>
#include <maya/MVector.h>
#include "rigidBodyNode.h"
#include "hingeConstraintNode.h"
#include "mayaUtils.h"
#include "solver.h"
#include "dSolverNode.h"
#include "constraint/bt_hinge_constraint.h"
MTypeId hingeConstraintNode::typeId(0x10033B);
MString hingeConstraintNode::typeName("dHingeConstraint");
MObject hingeConstraintNode::ia_rigidBodyA;
MObject hingeConstraintNode::ia_rigidBodyB;
MObject hingeConstraintNode::ia_damping;
MObject hingeConstraintNode::ia_lowerLimit;
MObject hingeConstraintNode::ia_upperLimit;
MObject hingeConstraintNode::ia_limitSoftness;
MObject hingeConstraintNode::ia_biasFactor;
MObject hingeConstraintNode::ia_relaxationFactor;
MObject hingeConstraintNode::ia_rotationInA;
MObject hingeConstraintNode::ia_rotationInB;
MObject hingeConstraintNode::ia_pivotInA;
MObject hingeConstraintNode::ia_pivotInB;
MObject hingeConstraintNode::ia_enableAngularMotor;
MObject hingeConstraintNode::ia_motorTargetVelocity;
MObject hingeConstraintNode::ia_maxMotorImpulse;
MObject hingeConstraintNode::ca_constraint;
MObject hingeConstraintNode::ca_constraintParam;
MStatus hingeConstraintNode::initialize()
{
MStatus status;
MFnMessageAttribute fnMsgAttr;
MFnNumericAttribute fnNumericAttr;
MFnMatrixAttribute fnMatrixAttr;
ia_rigidBodyA = fnMsgAttr.create("inRigidBodyA", "inrba", &status);
MCHECKSTATUS(status, "creating inRigidBodyA attribute")
status = addAttribute(ia_rigidBodyA);
MCHECKSTATUS(status, "adding inRigidBodyA attribute")
ia_rigidBodyB = fnMsgAttr.create("inRigidBodyB", "inrbb", &status);
MCHECKSTATUS(status, "creating inRigidBodyB attribute")
status = addAttribute(ia_rigidBodyB);
MCHECKSTATUS(status, "adding inRigidBodyB attribute")
ia_damping = fnNumericAttr.create("damping", "dmp", MFnNumericData::kDouble, 1.0, &status);
MCHECKSTATUS(status, "creating damping attribute")
fnNumericAttr.setKeyable(true);
status = addAttribute(ia_damping);
MCHECKSTATUS(status, "adding damping attribute")
ia_lowerLimit = fnNumericAttr.create("lowerLimit", "llmt", MFnNumericData::kDouble, 1.0, &status);
MCHECKSTATUS(status, "creating lower limit attribute")
fnNumericAttr.setKeyable(true);
status = addAttribute(ia_lowerLimit);
MCHECKSTATUS(status, "adding lower limit attribute")
ia_upperLimit = fnNumericAttr.create("upperLimit", "ulmt", MFnNumericData::kDouble, -1.0, &status);
MCHECKSTATUS(status, "creating upper limit attribute")
fnNumericAttr.setKeyable(true);
status = addAttribute(ia_upperLimit);
MCHECKSTATUS(status, "adding upper limit attribute")
ia_limitSoftness = fnNumericAttr.create("limitSoftness", "lmSo", MFnNumericData::kDouble, 0.9, &status);
MCHECKSTATUS(status, "creating limitSoftness attribute")
fnNumericAttr.setKeyable(true);
status = addAttribute(ia_limitSoftness);
MCHECKSTATUS(status, "adding limitSoftness attribute")
ia_biasFactor = fnNumericAttr.create("biasFactor", "biFa", MFnNumericData::kDouble, 0.3, &status);
MCHECKSTATUS(status, "creating biasFactor attribute")
fnNumericAttr.setKeyable(true);
status = addAttribute(ia_biasFactor);
MCHECKSTATUS(status, "adding biasFactor attribute")
ia_relaxationFactor = fnNumericAttr.create("relaxationFactor", "reFa", MFnNumericData::kDouble, 1.0, &status);
MCHECKSTATUS(status, "creating relaxationFactor attribute")
fnNumericAttr.setKeyable(true);
status = addAttribute(ia_relaxationFactor);
MCHECKSTATUS(status, "adding relaxationFactor attribute")
ia_rotationInA = fnNumericAttr.createPoint("rotationInA", "hgRotA", &status);
status = fnNumericAttr.setDefault((double) 0.0, (double) 0.0, (double) 0.0);
MCHECKSTATUS(status, "creating rotationInA attribute")
status = addAttribute(ia_rotationInA);
MCHECKSTATUS(status, "adding rotationInA attribute")
ia_rotationInB = fnNumericAttr.createPoint("rotationInB", "hgRotB", &status);
status = fnNumericAttr.setDefault((double) 0.0, (double) 0.0, (double) 0.0);
MCHECKSTATUS(status, "creating rotationInB attribute")
status = addAttribute(ia_rotationInB);
MCHECKSTATUS(status, "adding rotationInB attribute")
ia_pivotInA = fnNumericAttr.createPoint("pivotInA", "pivinA", &status);
status = fnNumericAttr.setDefault((double) 0.0, (double) 0.0, (double) 0.0);
MCHECKSTATUS(status, "creating pivotInA attribute")
status = addAttribute(ia_pivotInA);
MCHECKSTATUS(status, "adding pivotInA attribute")
ia_pivotInB = fnNumericAttr.createPoint("pivotInB", "pivinB", &status);
status = fnNumericAttr.setDefault((double) 0.0, (double) 0.0, (double) 0.0);
MCHECKSTATUS(status, "creating pivotInB attribute")
status = addAttribute(ia_pivotInB);
MCHECKSTATUS(status, "adding pivotInB attribute")
//------------------------------------------------------------------------------
ia_enableAngularMotor = fnNumericAttr.create("enableAngularMotor", "enAM", MFnNumericData::kBoolean, false, &status);
MCHECKSTATUS(status, "creating enableAngularMotor attribute")
status = addAttribute(ia_enableAngularMotor);
MCHECKSTATUS(status, "adding enableAngularMotor attribute")
ia_motorTargetVelocity = fnNumericAttr.create("motorTargetVelocity", "mTV", MFnNumericData::kDouble, 1, &status);
MCHECKSTATUS(status, "creating motorTargetVelocity attribute")
fnNumericAttr.setKeyable(true);
status = addAttribute(ia_motorTargetVelocity);
MCHECKSTATUS(status, "adding motorTargetVelocity attribute")
ia_maxMotorImpulse = fnNumericAttr.create("maxMotorImpulse", "mMI", MFnNumericData::kDouble, 1, &status);
MCHECKSTATUS(status, "creating maxMotorImpulse attribute")
fnNumericAttr.setKeyable(true);
status = addAttribute(ia_maxMotorImpulse);
MCHECKSTATUS(status, "adding maxMotorImpulse attribute")
//------------------------------------------------------------------------------
ca_constraint = fnNumericAttr.create("ca_constraint", "caco", MFnNumericData::kBoolean, 0, &status);
MCHECKSTATUS(status, "creating ca_constraint attribute")
fnNumericAttr.setConnectable(false);
fnNumericAttr.setHidden(true);
fnNumericAttr.setStorable(false);
fnNumericAttr.setKeyable(false);
status = addAttribute(ca_constraint);
MCHECKSTATUS(status, "adding ca_constraint attribute")
ca_constraintParam = fnNumericAttr.create("ca_constraintParam", "cacop", MFnNumericData::kBoolean, 0, &status);
MCHECKSTATUS(status, "creating ca_constraintParam attribute")
fnNumericAttr.setConnectable(false);
fnNumericAttr.setHidden(true);
fnNumericAttr.setStorable(false);
fnNumericAttr.setKeyable(false);
status = addAttribute(ca_constraintParam);
MCHECKSTATUS(status, "adding ca_constraintParam attribute")
status = attributeAffects(ia_rigidBodyA, ca_constraint);
MCHECKSTATUS(status, "adding attributeAffects(ia_rigidBodyA, ca_constraint)")
status = attributeAffects(ia_rigidBodyA, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_rigidBodyA, ca_constraintParam)")
status = attributeAffects(ia_rigidBodyB, ca_constraint);
MCHECKSTATUS(status, "adding attributeAffects(ia_rigidBodyB, ca_constraint)")
status = attributeAffects(ia_rigidBodyB, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_rigidBodyB, ca_constraintParam)")
status = attributeAffects(ia_damping, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_damping, ca_constraintParam)")
status = attributeAffects(ia_lowerLimit, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_lowerLimit, ca_constraintParam)")
status = attributeAffects(ia_upperLimit, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_upperLimit, ca_constraintParam)")
status = attributeAffects(ia_limitSoftness, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_limitSoftness, ca_constraintParam)")
status = attributeAffects(ia_biasFactor, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_biasFactor, ca_constraintParam)")
status = attributeAffects(ia_relaxationFactor, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_relaxationFactor, ca_constraintParam)")
status = attributeAffects(ia_rotationInA, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_rotationInA, ca_constraintParam)")
status = attributeAffects(ia_rotationInB, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_rotationInB, ca_constraintParam)")
status = attributeAffects(ia_pivotInA, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_pivotInA, ca_constraintParam)")
status = attributeAffects(ia_pivotInB, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_pivotInB, ca_constraintParam)")
status = attributeAffects(ia_enableAngularMotor, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_enableAngularMotor, ca_constraintParam)")
status = attributeAffects(ia_motorTargetVelocity, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_motorTargetVelocity, ca_constraintParam)")
status = attributeAffects(ia_maxMotorImpulse, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_maxMotorImpulse, ca_constraintParam)")
return MS::kSuccess;
}
hingeConstraintNode::hingeConstraintNode()
{
// std::cout << "hingeConstraintNode::hingeConstraintNode" << std::endl;
}
hingeConstraintNode::~hingeConstraintNode()
{
// std::cout << "hingeConstraintNode::~hingeConstraintNode" << std::endl;
}
void hingeConstraintNode::nodeRemoved(MObject& node, void *clientData)
{
// std::cout << "hingeConstraintNode::nodeRemoved" << std::endl;
MFnDependencyNode fnNode(node);
hingeConstraintNode *pNode = static_cast<hingeConstraintNode*>(fnNode.userNode());
if (pNode->m_constraint)
{
bt_hinge_constraint_t* hinge_impl = dynamic_cast<bt_hinge_constraint_t*>(pNode->m_constraint->pubImpl());
rigid_body_t::pointer rigid_bodyA = pNode->m_constraint->rigid_bodyA();
if(rigid_bodyA)
{
rigid_bodyA->remove_constraint(hinge_impl);
}
rigid_body_t::pointer rigid_bodyB = pNode->m_constraint->rigid_bodyB();
if(rigid_bodyB)
{
rigid_bodyB->remove_constraint(hinge_impl);
}
}
constraint_t::pointer constraint = static_cast<constraint_t::pointer>(pNode->m_constraint);
solver_t::remove_constraint(constraint);
}
void* hingeConstraintNode::creator()
{
return new hingeConstraintNode();
}
bool hingeConstraintNode::setInternalValueInContext ( const MPlug & plug,
const MDataHandle & dataHandle,
MDGContext & ctx)
{
/* if ((plug == pdbFiles) || (plug == ia_scale) || (plug == ia_percent)) {
m_framesDirty = true;
} else if(plug == textureFiles) {
gpufx::m_renderer.setColorTextureDirty();
}*/
return false; //setInternalValueInContext(plug,dataHandle,ctx);
}
MStatus hingeConstraintNode::compute(const MPlug& plug, MDataBlock& data)
{
//std::cout << "hingeConstraintNode::compute: " << plug.name() << std::endl;
//MTime time = data.inputValue( hingeConstraintNode::inTime ).asTime();
if(plug == ca_constraint) {
computeConstraint(plug, data);
} else if(plug == ca_constraintParam) {
computeConstraintParam(plug, data);
} else if(plug.isElement()) {
if(plug.array() == worldMatrix && plug.logicalIndex() == 0) {
computeWorldMatrix(plug, data);
} else {
return MStatus::kUnknownParameter;
}
} else {
return MStatus::kUnknownParameter;
}
return MStatus::kSuccess;
}
void hingeConstraintNode::draw( M3dView & view, const MDagPath &path,
M3dView::DisplayStyle style,
M3dView::DisplayStatus status )
{
// std::cout << "hingeConstraintNode::draw" << std::endl;
update();
view.beginGL();
glPushAttrib( GL_ALL_ATTRIB_BITS );
glDisable(GL_LIGHTING);
if( !(status == M3dView::kActive ||
status == M3dView::kLead ||
status == M3dView::kHilite ||
( style != M3dView::kGouraudShaded && style != M3dView::kFlatShaded )) ) {
glColor3f(1.0, 1.0, 0.0);
}
vec3f posA, posB, pivB;
rigid_body_t::pointer rigid_bodyB = NULL;
if (m_constraint)
{
vec3f pos;
quatf rot;
m_constraint->rigid_bodyA()->get_transform(pos, rot);
m_constraint->worldToA(pos, posA);
rigid_bodyB = m_constraint->rigid_bodyB();
if(rigid_bodyB)
{
rigid_bodyB->get_transform(pos, rot);
m_constraint->worldToA(pos, posB);
}
vec3f zeroVec(0.f,0.f,0.f);
m_constraint->worldFromB(zeroVec, pos);
m_constraint->worldToA(pos, pivB);
}
glBegin(GL_LINES);
glVertex3f(0.0, 0.0, 0.0);
glVertex3f(posA[0], posA[1], posA[2]);
glVertex3f(0.0, 0.0, 0.0);
glVertex3f(pivB[0], pivB[1], pivB[2]);
if(rigid_bodyB)
{
glVertex3f(pivB[0], pivB[1], pivB[2]);
glVertex3f(posB[0], posB[1], posB[2]);
}
glVertex3f(-1.0, 0.0, 0.0);
glVertex3f(1.0, 0.0, 0.0);
glVertex3f(0.0, -1.0, 0.0);
glVertex3f(0.0, 1.0, 0.0);
glVertex3f(0.0, 0.0, -1.0);
glVertex3f(0.0, 0.0, 1.0);
vec3f posT, posP, posM;
vec3f minusXVec(-1.f,0.f,0.f);
vec3f posXVec(1.f,0.f,0.f);
vec3f minusYVec (0.f,-1.f,0.f);
vec3f posYVec (0.f,1.f,0.f);
vec3f minusZVec (0.f,0.f,-1.f);
vec3f posZVec (0.f,0.f,1.f);
m_constraint->worldFromB(minusXVec, posT);
m_constraint->worldToA(posT, posM);
m_constraint->worldFromB(posXVec, posT);
m_constraint->worldToA(posT, posP);
glVertex3f(posM[0], posM[1], posM[2]);
glVertex3f(posP[0], posP[1], posP[2]);
m_constraint->worldFromB(minusYVec, posT);
m_constraint->worldToA(posT, posM);
m_constraint->worldFromB(posYVec, posT);
m_constraint->worldToA(posT, posP);
glVertex3f(posM[0], posM[1], posM[2]);
glVertex3f(posP[0], posP[1], posP[2]);
m_constraint->worldFromB(minusZVec, posT);
m_constraint->worldToA(posT, posM);
m_constraint->worldFromB(posZVec, posT);
m_constraint->worldToA(posT, posP);
glVertex3f(posM[0], posM[1], posM[2]);
glVertex3f(posP[0], posP[1], posP[2]);
glEnd();
glPopAttrib();
view.endGL();
}
bool hingeConstraintNode::isBounded() const
{
//return true;
return false;
}
MBoundingBox hingeConstraintNode::boundingBox() const
{
// std::cout << "hingeConstraintNode::boundingBox()" << std::endl;
//load the pdbs
MObject node = thisMObject();
MPoint corner1(-1, -1, -1);
MPoint corner2(1, 1, 1);
return MBoundingBox(corner1, corner2);
}
//standard attributes
void hingeConstraintNode::computeConstraint(const MPlug& plug, MDataBlock& data)
{
// std::cout << "hingeConstraintNode::computeConstraint" << std::endl;
MObject thisObject(thisMObject());
MPlug plgRigidBodyA(thisObject, ia_rigidBodyA);
MPlug plgRigidBodyB(thisObject, ia_rigidBodyB);
MObject update;
//force evaluation of the rigidBody
plgRigidBodyA.getValue(update);
plgRigidBodyB.getValue(update);
rigid_body_t::pointer rigid_bodyA;
if(plgRigidBodyA.isConnected()) {
MPlugArray connections;
plgRigidBodyA.connectedTo(connections, true, true);
if(connections.length() != 0) {
MFnDependencyNode fnNode(connections[0].node());
if(fnNode.typeId() == rigidBodyNode::typeId) {
rigidBodyNode *pRigidBodyNodeA = static_cast<rigidBodyNode*>(fnNode.userNode());
rigid_bodyA = pRigidBodyNodeA->rigid_body();
} else {
std::cout << "hingeConstraintNode connected to a non-rigidbody node A!" << std::endl;
}
}
}
rigid_body_t::pointer rigid_bodyB;
if(plgRigidBodyB.isConnected()) {
MPlugArray connections;
plgRigidBodyB.connectedTo(connections, true, true);
if(connections.length() != 0) {
MFnDependencyNode fnNode(connections[0].node());
if(fnNode.typeId() == rigidBodyNode::typeId) {
rigidBodyNode *pRigidBodyNodeB = static_cast<rigidBodyNode*>(fnNode.userNode());
rigid_bodyB = pRigidBodyNodeB->rigid_body();
} else {
std::cout << "hingeConstraintNode connected to a non-rigidbody node B!" << std::endl;
}
}
}
vec3f pivInA, pivInB;
if((rigid_bodyA != NULL) && (rigid_bodyB != NULL))
{
constraint_t::pointer constraint = static_cast<constraint_t::pointer>(m_constraint);
solver_t::remove_constraint(constraint);
float3& mPivInA = data.inputValue(ia_pivotInA).asFloat3();
float3& mPivInB = data.inputValue(ia_pivotInB).asFloat3();
for(int i = 0; i < 3; i++)
{
pivInA[i] = (float)mPivInA[i];
pivInB[i] = (float)mPivInB[i];
}
float3& mRotInA = data.inputValue(ia_rotationInA).asFloat3();
MEulerRotation meulerA(deg2rad(mRotInA[0]), deg2rad(mRotInA[1]), deg2rad(mRotInA[2]));
MQuaternion mquatA = meulerA.asQuaternion();
quatf rotA((float)mquatA.w, (float)mquatA.x, (float)mquatA.y, (float)mquatA.z);
float3& mRotInB = data.inputValue(ia_rotationInB).asFloat3();
MEulerRotation meulerB(deg2rad(mRotInB[0]), deg2rad(mRotInB[1]), deg2rad(mRotInB[2]));
MQuaternion mquatB = meulerB.asQuaternion();
quatf rotB((float)mquatB.w, (float)mquatB.x, (float)mquatB.y, (float)mquatB.z);
m_constraint = solver_t::create_hinge_constraint(rigid_bodyA, pivInA, rotA, rigid_bodyB, pivInB, rotB);
constraint = static_cast<constraint_t::pointer>(m_constraint);
solver_t::add_constraint(constraint);
}
else if(rigid_bodyA != NULL)
{
//not connected to a rigid body, put a default one
constraint_t::pointer constraint = static_cast<constraint_t::pointer>(m_constraint);
solver_t::remove_constraint(constraint);
float3& mPivInA = data.inputValue(ia_pivotInA).asFloat3();
for(int i = 0; i < 3; i++)
{
pivInA[i] = (float)mPivInA[i];
}
float3& mRotInA = data.inputValue(ia_rotationInA).asFloat3();
MEulerRotation meuler(deg2rad(mRotInA[0]), deg2rad(mRotInA[1]), deg2rad(mRotInA[2]));
MQuaternion mquat = meuler.asQuaternion();
quatf rotA((float)mquat.w, (float)mquat.x, (float)mquat.y, (float)mquat.z);
m_constraint = solver_t::create_hinge_constraint(rigid_bodyA, pivInA, rotA);
constraint = static_cast<constraint_t::pointer>(m_constraint);
solver_t::add_constraint(constraint);
}
data.outputValue(ca_constraint).set(true);
data.setClean(plug);
}
void hingeConstraintNode::computeWorldMatrix(const MPlug& plug, MDataBlock& data)
{
MObject thisObject(thisMObject());
MFnDagNode fnDagNode(thisObject);
MObject update;
MPlug(thisObject, ca_constraint).getValue(update);
MPlug(thisObject, ca_constraintParam).getValue(update);
MStatus status;
MFnTransform fnParentTransform(fnDagNode.parent(0, &status));
double fixScale[3] = { 1., 1., 1. }; // lock scale
fnParentTransform.setScale(fixScale);
MVector mtranslation = fnParentTransform.getTranslation(MSpace::kTransform, &status);
if(dSolverNode::isStartTime)
{ // allow to edit pivots
MPlug plgRigidBodyA(thisObject, ia_rigidBodyA);
MPlug plgRigidBodyB(thisObject, ia_rigidBodyB);
MObject update;
//force evaluation of the rigidBody
plgRigidBodyA.getValue(update);
if(plgRigidBodyA.isConnected())
{
MPlugArray connections;
plgRigidBodyA.connectedTo(connections, true, true);
if(connections.length() != 0)
{
MFnDependencyNode fnNode(connections[0].node());
if(fnNode.typeId() == rigidBodyNode::typeId)
{
MObject rbAObj = fnNode.object();
rigidBodyNode *pRigidBodyNodeA = static_cast<rigidBodyNode*>(fnNode.userNode());
MPlug(rbAObj, pRigidBodyNodeA->worldMatrix).elementByLogicalIndex(0).getValue(update);
}
}
}
plgRigidBodyB.getValue(update);
if(plgRigidBodyB.isConnected())
{
MPlugArray connections;
plgRigidBodyB.connectedTo(connections, true, true);
if(connections.length() != 0)
{
MFnDependencyNode fnNode(connections[0].node());
if(fnNode.typeId() == rigidBodyNode::typeId)
{
MObject rbBObj = fnNode.object();
rigidBodyNode *pRigidBodyNodeB = static_cast<rigidBodyNode*>(fnNode.userNode());
MPlug(rbBObj, pRigidBodyNodeB->worldMatrix).elementByLogicalIndex(0).getValue(update);
}
}
}
if(m_constraint)
{
MQuaternion mrotation;
fnParentTransform.getRotation(mrotation, MSpace::kTransform);
bool doUpdatePivot = m_constraint->getPivotChanged();
if(!doUpdatePivot)
{
vec3f worldP;
quatf worldR;
m_constraint->get_world(worldP, worldR);
float deltaPX = worldP[0] - float(mtranslation.x);
float deltaPY = worldP[1] - float(mtranslation.y);
float deltaPZ = worldP[2] - float(mtranslation.z);
float deltaRX = (float)mrotation.x - worldR[1];
float deltaRY = (float)mrotation.y - worldR[2];
float deltaRZ = (float)mrotation.z - worldR[3];
float deltaRW = (float)mrotation.w - worldR[0];
float deltaSq = deltaPX * deltaPX + deltaPY * deltaPY + deltaPZ * deltaPZ
+ deltaRX * deltaRX + deltaRY * deltaRY + deltaRZ * deltaRZ + deltaRW * deltaRW;
doUpdatePivot = (deltaSq > FLT_EPSILON);
}
if(doUpdatePivot)
{
m_constraint->set_world(vec3f((float) mtranslation[0], (float) mtranslation[1], (float) mtranslation[2]),
quatf((float)mrotation.w, (float)mrotation.x, (float)mrotation.y, (float)mrotation.z));
vec3f pivInA, pivInB;
quatf rotInA, rotInB;
m_constraint->get_frameA(pivInA, rotInA);
m_constraint->get_frameB(pivInB, rotInB);
MDataHandle hPivInA = data.outputValue(ia_pivotInA);
float3 &ihPivInA = hPivInA.asFloat3();
MDataHandle hPivInB = data.outputValue(ia_pivotInB);
float3 &ihPivInB = hPivInB.asFloat3();
for(int i = 0; i < 3; i++)
{
ihPivInA[i] = pivInA[i];
ihPivInB[i] = pivInB[i];
}
MDataHandle hRotInA = data.outputValue(ia_rotationInA);
float3 &hrotInA = hRotInA.asFloat3();
MQuaternion mrotA(rotInA[1], rotInA[2], rotInA[3], rotInA[0]);
MEulerRotation newrotA(mrotA.asEulerRotation());
hrotInA[0] = rad2deg((float)newrotA.x);
hrotInA[1] = rad2deg((float)newrotA.y);
hrotInA[2] = rad2deg((float)newrotA.z);
MDataHandle hRotInB = data.outputValue(ia_rotationInB);
float3 &hrotInB = hRotInB.asFloat3();
MQuaternion mrotB(rotInB[1], rotInB[2], rotInB[3], rotInB[0]);
MEulerRotation newrotB(mrotB.asEulerRotation());
hrotInB[0] = rad2deg((float)newrotB.x);
hrotInB[1] = rad2deg((float)newrotB.y);
hrotInB[2] = rad2deg((float)newrotB.z);
m_constraint->setPivotChanged(false);
}
}
}
else
{ // if not start time, lock position and rotation
if(m_constraint)
{
vec3f worldP;
quatf worldR;
m_constraint->get_world(worldP, worldR);
fnParentTransform.setTranslation(MVector(worldP[0], worldP[1], worldP[2]), MSpace::kTransform);
fnParentTransform.setRotation(MQuaternion(worldR[1], worldR[2], worldR[3], worldR[0]));
}
}
data.setClean(plug);
}
void hingeConstraintNode::computeConstraintParam(const MPlug& plug, MDataBlock& data)
{
//std::cout << "hingeConstraintNode::computeRigidBodyParam data.className=" << std::endl;
MObject thisObject(thisMObject());
MObject update;
MPlug(thisObject, ca_constraint).getValue(update);
if(m_constraint) {
float damping = (float) data.inputValue(ia_damping).asDouble();
m_constraint->set_damping(damping);
float lower = (float) data.inputValue(ia_lowerLimit).asDouble();
float upper = (float) data.inputValue(ia_upperLimit).asDouble();
float limit_softness = (float) data.inputValue(ia_limitSoftness).asDouble();
float bias_factor = (float) data.inputValue(ia_biasFactor).asDouble();
float relaxation_factor = (float) data.inputValue(ia_relaxationFactor).asDouble();
m_constraint->set_limit(deg2rad(lower), deg2rad(upper), limit_softness, bias_factor, relaxation_factor);
bool enable_motor = data.inputValue(ia_enableAngularMotor).asBool();
float motorTargetVelocity = (float) data.inputValue(ia_motorTargetVelocity).asDouble();
float maxMotorImpulse = (float) data.inputValue(ia_maxMotorImpulse).asDouble();
m_constraint->enable_motor(enable_motor, motorTargetVelocity, maxMotorImpulse);
}
data.outputValue(ca_constraintParam).set(true);
data.setClean(plug);
}
hinge_constraint_t::pointer hingeConstraintNode::constraint()
{
// std::cout << "hingeConstraintNode::rigid_body" << std::endl;
MObject thisObject(thisMObject());
MObject update;
MPlug(thisObject, ca_constraint).getValue(update);
MPlug(thisObject, ca_constraintParam).getValue(update);
return m_constraint;
}
void hingeConstraintNode::update()
{
MObject thisObject(thisMObject());
MObject update;
MPlug(thisObject, ca_constraint).getValue(update);
MPlug(thisObject, ca_constraintParam).getValue(update);
MPlug(thisObject, worldMatrix).elementByLogicalIndex(0).getValue(update);
}

View File

@@ -1,114 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Herbert Law
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Herbert Law <Herbert.Law@gmail.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/
//hingeConstraintNode.h
#ifndef DYN_HINGE_CONSTRAINT_NODE_H
#define DYN_HINGE_CONSTRAINT_NODE_H
#include <maya/MString.h>
#include <maya/MTypeId.h>
#include <maya/MPxLocatorNode.h>
#include "solver.h"
class hingeConstraintNode: public MPxLocatorNode
{
public:
hingeConstraintNode();
virtual ~hingeConstraintNode();
virtual bool setInternalValueInContext ( const MPlug & plug,
const MDataHandle & dataHandle,
MDGContext & ctx);
// virtual MStatus setDependentsDirty ( const MPlug & plug, MPlugArray & plugArray);
virtual MStatus compute( const MPlug& plug, MDataBlock& data );
virtual void draw( M3dView & view, const MDagPath & path,
M3dView::DisplayStyle style,
M3dView::DisplayStatus status );
virtual bool isBounded() const ;
virtual MBoundingBox boundingBox() const;
virtual bool excludeAsLocator() const { return false; }
virtual bool isTransparent() const { return false; }
static void * creator();
static MStatus initialize();
public:
hinge_constraint_t::pointer constraint();
void update();
public:
//Attributes
static MObject ia_rigidBodyA;
static MObject ia_rigidBodyB;
static MObject ia_damping;
static MObject ia_lowerLimit;
static MObject ia_upperLimit;
static MObject ia_limitSoftness;
static MObject ia_biasFactor;
static MObject ia_relaxationFactor;
static MObject ia_rotationInA;
static MObject ia_rotationInB;
static MObject ia_pivotInA;
static MObject ia_pivotInB;
static MObject ca_constraint;
static MObject ca_constraintParam;
static MObject ia_enableAngularMotor;
static MObject ia_motorTargetVelocity;
static MObject ia_maxMotorImpulse;
public:
static MTypeId typeId;
static MString typeName;
private:
void computeConstraint(const MPlug& plug, MDataBlock& data);
void computeConstraintParam(const MPlug& plug, MDataBlock& data);
void computeWorldMatrix(const MPlug& plug, MDataBlock& data);
public:
static void nodeRemoved(MObject& node, void *clientData);
private:
hinge_constraint_t::pointer m_constraint;
};
#endif //DYN_HINGE_CONSTRAINT_NODE_H

View File

@@ -1,136 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Herbert Law
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Herbert Law <Herbert.Law@gmail.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/
//hinge_constraint.h
#ifndef DYN_HINGE_CONSTRAINT_H
#define DYN_HINGE_CONSTRAINT_H
#include "shared_ptr.h"
#include "rigid_body.h"
#include "mathUtils.h"
#include "constraint.h"
#include "hinge_constraint_impl.h"
class hinge_constraint_t: public constraint_t
{
public:
//typedefs
typedef shared_ptr<hinge_constraint_t> pointer;
//
rigid_body_t::pointer rigid_bodyA() { return m_rigid_bodyA; }
rigid_body_t::pointer rigid_bodyB() { return m_rigid_bodyB; }
//
void get_frameA(vec3f& p, quatf& r) const {
hinge_constraint_impl_t const* hinge_impl = dynamic_cast<hinge_constraint_impl_t const*>(impl());
hinge_impl->get_frameA(p, r);
}
void get_frameB(vec3f& p, quatf& r) const {
hinge_constraint_impl_t const* hinge_impl = dynamic_cast<hinge_constraint_impl_t const*>(impl());
hinge_impl->get_frameB(p, r);
}
void get_invFrameA(vec3f& p, quatf& r) const {
hinge_constraint_impl_t const* hinge_impl = dynamic_cast<hinge_constraint_impl_t const*>(impl());
hinge_impl->get_invFrameA(p, r);
}
void get_invFrameB(vec3f& p, quatf& r) const {
hinge_constraint_impl_t const* hinge_impl = dynamic_cast<hinge_constraint_impl_t const*>(impl());
hinge_impl->get_invFrameB(p, r);
}
void worldToA(vec3f& w, vec3f& p) const {
hinge_constraint_impl_t const* hinge_impl = dynamic_cast<hinge_constraint_impl_t const*>(impl());
hinge_impl->worldToA(w, p);
}
void worldFromB(vec3f& p, vec3f& w) const {
hinge_constraint_impl_t const* hinge_impl = dynamic_cast<hinge_constraint_impl_t const*>(impl());
hinge_impl->worldFromB(p, w);
}
//
void set_damping(float d) {
hinge_constraint_impl_t* hinge_impl = dynamic_cast<hinge_constraint_impl_t*>(impl());
hinge_impl->set_damping(d);
}
void set_limit(float lower, float upper, float softness, float bias_factor, float relaxation_factor) {
hinge_constraint_impl_t* hinge_impl = dynamic_cast<hinge_constraint_impl_t*>(impl());
hinge_impl->set_limit(lower, upper, softness, bias_factor, relaxation_factor);
}
void set_axis(vec3f const& p) {
hinge_constraint_impl_t* hinge_impl = dynamic_cast<hinge_constraint_impl_t*>(impl());
hinge_impl->set_axis(p);
}
float damping() const {
hinge_constraint_impl_t const* hinge_impl = dynamic_cast<hinge_constraint_impl_t const*>(impl());
return hinge_impl->damping();
}
void set_world(vec3f const& p, quatf const& r)
{
hinge_constraint_impl_t* hinge_impl = dynamic_cast<hinge_constraint_impl_t*>(impl());
hinge_impl->set_world(p, r);
}
//local space pivot
void get_world(vec3f& p, quatf& r) const {
hinge_constraint_impl_t const* hinge_impl = dynamic_cast<hinge_constraint_impl_t const*>(impl());
hinge_impl->get_world(p, r);
}
void enable_motor(bool enable, float velocity, float impulse) {
hinge_constraint_impl_t* hinge_impl = dynamic_cast<hinge_constraint_impl_t*>(impl());
hinge_impl->enable_motor(enable, velocity, impulse);
}
public:
virtual ~hinge_constraint_t() {};
protected:
friend class solver_t;
hinge_constraint_t(hinge_constraint_impl_t* impl, rigid_body_t::pointer& rigid_body):
constraint_t(impl),
m_rigid_bodyA(rigid_body)
{
}
hinge_constraint_t(hinge_constraint_impl_t* impl, rigid_body_t::pointer& rigid_bodyA, rigid_body_t::pointer& rigid_bodyB):
constraint_t(impl),
m_rigid_bodyA(rigid_bodyA),
m_rigid_bodyB(rigid_bodyB)
{
}
private:
rigid_body_t::pointer m_rigid_bodyA;
rigid_body_t::pointer m_rigid_bodyB;
};
#endif //DYN_HINGE_CONSTRAINT_H

View File

@@ -1,58 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Herbert Law
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Herbert Law <Herbert.Law@gmail.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/
//hinge_constraint_impl.h
#ifndef DYN_HINGE_CONSTRAINT_IMPL_H
#define DYN_HINGE_CONSTRAINT_IMPL_H
#include "constraint_impl.h"
class hinge_constraint_impl_t: public constraint_impl_t
{
public:
//
virtual void set_world(vec3f const& p, quatf const& r) = 0;
virtual void get_world(vec3f& p, quatf& r) const = 0;
virtual void get_frameA(vec3f& p, quatf& r) const = 0;
virtual void get_frameB(vec3f& p, quatf& r) const = 0;
virtual void get_invFrameA(vec3f& p, quatf& r) const = 0;
virtual void get_invFrameB(vec3f& p, quatf& r) const = 0;
virtual void worldToA(vec3f& w, vec3f& p) const = 0;
virtual void worldFromB(vec3f& p, vec3f& w) const = 0;
//
virtual void set_damping(float d) = 0;
virtual float damping() const = 0;
virtual void set_limit(float lower, float upper, float softness, float bias_factor, float relaxation_factor) = 0;
virtual void set_axis(vec3f const& p) = 0;
virtual void enable_motor(bool enable, float velocity, float impulse) = 0;
public:
virtual ~hinge_constraint_impl_t() {};
};
#endif //DYN_HINGE_CONSTRAINT_IMPL_H

View File

@@ -1,517 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Walt Disney Studios
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Nicola Candussi <nicola@fluidinteractive.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/
//nailConstraintNode.cpp
#include <maya/MFnDependencyNode.h>
#include <maya/MPlugArray.h>
#include <maya/MFnMessageAttribute.h>
#include <maya/MFnNumericAttribute.h>
#include <maya/MFnMatrixAttribute.h>
#include <maya/MMatrix.h>
#include <maya/MFnMatrixData.h>
#include <maya/MFnTransform.h>
#include <maya/MQuaternion.h>
#include <maya/MEulerRotation.h>
#include <maya/MVector.h>
#include "rigidBodyNode.h"
#include "nailConstraintNode.h"
#include "mayaUtils.h"
#include "solver.h"
#include "dSolverNode.h"
#include "constraint/bt_nail_constraint.h"
MTypeId nailConstraintNode::typeId(0x10033A);
MString nailConstraintNode::typeName("dNailConstraint");
MObject nailConstraintNode::ia_rigidBodyA;
MObject nailConstraintNode::ia_rigidBodyB;
MObject nailConstraintNode::ia_damping;
MObject nailConstraintNode::ia_pivotInA;
MObject nailConstraintNode::ia_pivotInB;
MObject nailConstraintNode::ca_constraint;
MObject nailConstraintNode::ca_constraintParam;
MStatus nailConstraintNode::initialize()
{
MStatus status;
MFnMessageAttribute fnMsgAttr;
MFnNumericAttribute fnNumericAttr;
MFnMatrixAttribute fnMatrixAttr;
ia_rigidBodyA = fnMsgAttr.create("inRigidBodyA", "inrbA", &status);
MCHECKSTATUS(status, "creating inRigidBodyA attribute")
status = addAttribute(ia_rigidBodyA);
MCHECKSTATUS(status, "adding inRigidBodyA attribute")
ia_rigidBodyB = fnMsgAttr.create("inRigidBodyB", "inrbB", &status);
MCHECKSTATUS(status, "creating inRigidBodyB attribute")
status = addAttribute(ia_rigidBodyB);
MCHECKSTATUS(status, "adding inRigidBodyB attribute")
ia_damping = fnNumericAttr.create("damping", "dmp", MFnNumericData::kDouble, 1.0, &status);
MCHECKSTATUS(status, "creating damping attribute")
fnNumericAttr.setKeyable(true);
status = addAttribute(ia_damping);
MCHECKSTATUS(status, "adding damping attribute")
ia_pivotInA = fnNumericAttr.createPoint("pivotInA", "piva", &status);
MCHECKSTATUS(status, "creating pivotInA attribute")
status = addAttribute(ia_pivotInA);
MCHECKSTATUS(status, "adding pivotInA attribute")
ia_pivotInB = fnNumericAttr.createPoint("pivotInB", "pivb", &status);
MCHECKSTATUS(status, "creating pivotInB attribute")
status = addAttribute(ia_pivotInB);
MCHECKSTATUS(status, "adding pivotInB attribute")
ca_constraint = fnNumericAttr.create("ca_constraint", "caco", MFnNumericData::kBoolean, 0, &status);
MCHECKSTATUS(status, "creating ca_constraint attribute")
fnNumericAttr.setConnectable(false);
fnNumericAttr.setHidden(true);
fnNumericAttr.setStorable(false);
fnNumericAttr.setKeyable(false);
status = addAttribute(ca_constraint);
MCHECKSTATUS(status, "adding ca_constraint attribute")
ca_constraintParam = fnNumericAttr.create("ca_constraintParam", "cacop", MFnNumericData::kBoolean, 0, &status);
MCHECKSTATUS(status, "creating ca_constraintParam attribute")
fnNumericAttr.setConnectable(false);
fnNumericAttr.setHidden(true);
fnNumericAttr.setStorable(false);
fnNumericAttr.setKeyable(false);
status = addAttribute(ca_constraintParam);
MCHECKSTATUS(status, "adding ca_constraintParam attribute")
status = attributeAffects(ia_rigidBodyA, ca_constraint);
MCHECKSTATUS(status, "adding attributeAffects(ia_rigidBodyA, ca_constraint)")
status = attributeAffects(ia_rigidBodyA, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_rigidBodyA, ca_constraintParam)")
status = attributeAffects(ia_rigidBodyB, ca_constraint);
MCHECKSTATUS(status, "adding attributeAffects(ia_rigidBodyB, ca_constraint)")
status = attributeAffects(ia_rigidBodyB, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_rigidBodyB, ca_constraintParam)")
status = attributeAffects(ia_pivotInA, ca_constraint);
MCHECKSTATUS(status, "adding attributeAffects(ia_pivotInA, ca_constraint)")
status = attributeAffects(ia_pivotInA, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_pivotInA, ca_constraintParam)")
status = attributeAffects(ia_pivotInB, ca_constraint);
MCHECKSTATUS(status, "adding attributeAffects(ia_pivotInB, ca_constraint)")
status = attributeAffects(ia_pivotInB, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_pivotInB, ca_constraintParam)")
status = attributeAffects(ia_damping, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_damping, ca_constraintParam)")
return MS::kSuccess;
}
nailConstraintNode::nailConstraintNode()
{
// std::cout << "nailConstraintNode::nailConstraintNode" << std::endl;
}
nailConstraintNode::~nailConstraintNode()
{
// std::cout << "nailConstraintNode::~nailConstraintNode" << std::endl;
}
void nailConstraintNode::nodeRemoved(MObject& node, void *clientData)
{
// std::cout << "nailConstraintNode::nodeRemoved" << std::endl;
MFnDependencyNode fnNode(node);
nailConstraintNode *pNode = static_cast<nailConstraintNode*>(fnNode.userNode());
if (pNode->m_constraint)
{
bt_nail_constraint_t* nail_impl = dynamic_cast<bt_nail_constraint_t*>(pNode->m_constraint->pubImpl());
rigid_body_t::pointer rigid_bodyA = pNode->m_constraint->rigid_bodyA();
if(rigid_bodyA)
{
rigid_bodyA->remove_constraint(nail_impl);
}
rigid_body_t::pointer rigid_bodyB = pNode->m_constraint->rigid_bodyB();
if(rigid_bodyB)
{
rigid_bodyB->remove_constraint(nail_impl);
}
}
constraint_t::pointer constraint = static_cast<constraint_t::pointer>(pNode->m_constraint);
solver_t::remove_constraint(constraint);
}
void* nailConstraintNode::creator()
{
return new nailConstraintNode();
}
bool nailConstraintNode::setInternalValueInContext ( const MPlug & plug,
const MDataHandle & dataHandle,
MDGContext & ctx)
{
/* if ((plug == pdbFiles) || (plug == ia_scale) || (plug == ia_percent)) {
m_framesDirty = true;
} else if(plug == textureFiles) {
gpufx::m_renderer.setColorTextureDirty();
}*/
return false; //setInternalValueInContext(plug,dataHandle,ctx);
}
MStatus nailConstraintNode::compute(const MPlug& plug, MDataBlock& data)
{
//std::cout << "nailConstraintNode::compute: " << plug.name() << std::endl;
//MTime time = data.inputValue( nailConstraintNode::inTime ).asTime();
if(plug == ca_constraint) {
computeConstraint(plug, data);
} else if(plug == ca_constraintParam) {
computeConstraintParam(plug, data);
} else if(plug.isElement()) {
if(plug.array() == worldMatrix && plug.logicalIndex() == 0) {
computeWorldMatrix(plug, data);
} else {
return MStatus::kUnknownParameter;
}
} else {
return MStatus::kUnknownParameter;
}
return MStatus::kSuccess;
}
void nailConstraintNode::draw( M3dView & view, const MDagPath &path,
M3dView::DisplayStyle style,
M3dView::DisplayStatus status )
{
// std::cout << "nailConstraintNode::draw" << std::endl;
update();
view.beginGL();
glPushAttrib( GL_ALL_ATTRIB_BITS );
glDisable(GL_LIGHTING);
if( !(status == M3dView::kActive ||
status == M3dView::kLead ||
status == M3dView::kHilite ||
( style != M3dView::kGouraudShaded && style != M3dView::kFlatShaded )) ) {
glColor3f(1.0, 1.0, 0.0);
}
vec3f posA, posB;
rigid_body_t::pointer rigid_bodyB = NULL;
vec3f world;
if (m_constraint) {
m_constraint->get_world(world);
vec3f posT;
quatf rotT;
m_constraint->rigid_bodyA()->get_transform(posT, rotT);
posA = posT - world;
rigid_bodyB = m_constraint->rigid_bodyB();
if(rigid_bodyB)
{
rigid_bodyB->get_transform(posT, rotT);
posB = posT - world;
}
}
glBegin(GL_LINES);
glVertex3f(0.0, 0.0, 0.0);
glVertex3f(posA[0], posA[1], posA[2]);
if(rigid_bodyB)
{
vec3f pivB;
m_constraint->get_world_pivotB(pivB);
for(int j = 0; j < 3; j++) pivB[j] -= world[j];
glVertex3f(pivB[0], pivB[1], pivB[2]);
glVertex3f(posB[0], posB[1], posB[2]);
glVertex3f(-1.0f+pivB[0], 0.0f+pivB[1], 0.0f+pivB[2]);
glVertex3f( 1.0f+pivB[0], 0.0f+pivB[1], 0.0f+pivB[2]);
glVertex3f( 0.0f+pivB[0], -1.0f+pivB[1], 0.0f+pivB[2]);
glVertex3f( 0.0f+pivB[0], 1.0f+pivB[1], 0.0f+pivB[2]);
glVertex3f( 0.0f+pivB[0], 0.0f+pivB[1], -1.0f+pivB[2]);
glVertex3f( 0.0f+pivB[0], 0.0f+pivB[1], 1.0f+pivB[2]);
}
glVertex3f(-1.0, 0.0, 0.0);
glVertex3f(1.0, 0.0, 0.0);
glVertex3f(0.0, -1.0, 0.0);
glVertex3f(0.0, 1.0, 0.0);
glVertex3f(0.0, 0.0, -1.0);
glVertex3f(0.0, 0.0, 1.0);
glEnd();
glPopAttrib();
view.endGL();
}
bool nailConstraintNode::isBounded() const
{
//return true;
return false;
}
MBoundingBox nailConstraintNode::boundingBox() const
{
// std::cout << "nailConstraintNode::boundingBox()" << std::endl;
//load the pdbs
MObject node = thisMObject();
MPoint corner1(-1, -1, -1);
MPoint corner2(1, 1, 1);
return MBoundingBox(corner1, corner2);
}
//standard attributes
void nailConstraintNode::computeConstraint(const MPlug& plug, MDataBlock& data)
{
// std::cout << "nailConstraintNode::computeConstraint" << std::endl;
MObject thisObject(thisMObject());
MPlug plgRigidBodyA(thisObject, ia_rigidBodyA);
MPlug plgRigidBodyB(thisObject, ia_rigidBodyB);
MObject update;
//force evaluation of the rigidBody
plgRigidBodyA.getValue(update);
plgRigidBodyB.getValue(update);
rigid_body_t::pointer rigid_bodyA;
if(plgRigidBodyA.isConnected()) {
MPlugArray connections;
plgRigidBodyA.connectedTo(connections, true, true);
if(connections.length() != 0) {
MFnDependencyNode fnNode(connections[0].node());
if(fnNode.typeId() == rigidBodyNode::typeId) {
rigidBodyNode *pRigidBodyNodeA = static_cast<rigidBodyNode*>(fnNode.userNode());
rigid_bodyA = pRigidBodyNodeA->rigid_body();
} else {
std::cout << "nailConstraintNode connected to a non-rigidbody node A!" << std::endl;
}
}
}
rigid_body_t::pointer rigid_bodyB;
if(plgRigidBodyB.isConnected()) {
MPlugArray connections;
plgRigidBodyB.connectedTo(connections, true, true);
if(connections.length() != 0) {
MFnDependencyNode fnNode(connections[0].node());
if(fnNode.typeId() == rigidBodyNode::typeId) {
rigidBodyNode *pRigidBodyNodeB = static_cast<rigidBodyNode*>(fnNode.userNode());
rigid_bodyB = pRigidBodyNodeB->rigid_body();
} else {
std::cout << "nailConstraintNode connected to a non-rigidbody node B!" << std::endl;
}
}
}
vec3f pivInA, pivInB;
if((rigid_bodyA != NULL) && (rigid_bodyB != NULL))
{
constraint_t::pointer constraint = static_cast<constraint_t::pointer>(m_constraint);
solver_t::remove_constraint(constraint);
float3& mPivInA = data.inputValue(ia_pivotInA).asFloat3();
float3& mPivInB = data.inputValue(ia_pivotInB).asFloat3();
for(int i = 0; i < 3; i++)
{
pivInA[i] = (float)mPivInA[i];
pivInB[i] = (float)mPivInB[i];
}
m_constraint = solver_t::create_nail_constraint(rigid_bodyA, rigid_bodyB, pivInA, pivInB);
constraint = static_cast<constraint_t::pointer>(m_constraint);
solver_t::add_constraint(constraint);
}
else if(rigid_bodyA)
{
//not connected to a rigid body, put a default one
constraint_t::pointer constraint = static_cast<constraint_t::pointer>(m_constraint);
solver_t::remove_constraint(constraint);
float3& mPivInA = data.inputValue(ia_pivotInA).asFloat3();
for(int i = 0; i < 3; i++)
{
pivInA[i] = (float)mPivInA[i];
}
m_constraint = solver_t::create_nail_constraint(rigid_bodyA, pivInA);
constraint = static_cast<constraint_t::pointer>(m_constraint);
solver_t::add_constraint(constraint);
}
data.outputValue(ca_constraint).set(true);
data.setClean(plug);
}
void nailConstraintNode::computeWorldMatrix(const MPlug& plug, MDataBlock& data)
{
// std::cout << "nailConstraintNode::computeWorldMatrix" << std::endl;
MObject thisObject(thisMObject());
MFnDagNode fnDagNode(thisObject);
MObject update;
MPlug(thisObject, ca_constraint).getValue(update);
MPlug(thisObject, ca_constraintParam).getValue(update);
MStatus status;
MFnTransform fnParentTransform(fnDagNode.parent(0, &status));
fnParentTransform.setRotation(MEulerRotation(0., 0., 0.)); // lock rotation
double fixScale[3] = { 1., 1., 1. }; // lock scale
fnParentTransform.setScale(fixScale);
MVector mtranslation = fnParentTransform.getTranslation(MSpace::kTransform, &status);
if(dSolverNode::isStartTime)
{ // allow to edit pivots
MPlug plgRigidBodyA(thisObject, ia_rigidBodyA);
MPlug plgRigidBodyB(thisObject, ia_rigidBodyB);
MObject update;
//force evaluation of the rigidBody
plgRigidBodyA.getValue(update);
if(plgRigidBodyA.isConnected())
{
MPlugArray connections;
plgRigidBodyA.connectedTo(connections, true, true);
if(connections.length() != 0)
{
MFnDependencyNode fnNode(connections[0].node());
if(fnNode.typeId() == rigidBodyNode::typeId)
{
MObject rbAObj = fnNode.object();
rigidBodyNode *pRigidBodyNodeA = static_cast<rigidBodyNode*>(fnNode.userNode());
MPlug(rbAObj, pRigidBodyNodeA->worldMatrix).elementByLogicalIndex(0).getValue(update);
}
}
}
plgRigidBodyB.getValue(update);
if(plgRigidBodyB.isConnected())
{
MPlugArray connections;
plgRigidBodyB.connectedTo(connections, true, true);
if(connections.length() != 0)
{
MFnDependencyNode fnNode(connections[0].node());
if(fnNode.typeId() == rigidBodyNode::typeId)
{
MObject rbBObj = fnNode.object();
rigidBodyNode *pRigidBodyNodeB = static_cast<rigidBodyNode*>(fnNode.userNode());
MPlug(rbBObj, pRigidBodyNodeB->worldMatrix).elementByLogicalIndex(0).getValue(update);
}
}
}
if(m_constraint)
{
bool doUpdatePivot = m_constraint->getPivotChanged();
if(!doUpdatePivot)
{
vec3f world;
m_constraint->get_world(world);
float deltaX = world[0] - float(mtranslation.x);
float deltaY = world[1] - float(mtranslation.y);
float deltaZ = world[2] - float(mtranslation.z);
float deltaSq = deltaX * deltaX + deltaY * deltaY + deltaZ * deltaZ;
doUpdatePivot = (deltaSq > FLT_EPSILON);
}
if(doUpdatePivot)
{
m_constraint->set_world(vec3f((float) mtranslation[0], (float) mtranslation[1], (float) mtranslation[2]));
vec3f pivInA, pivInB;
m_constraint->get_pivotA(pivInA);
m_constraint->get_pivotB(pivInB);
MDataHandle hPivInA = data.outputValue(ia_pivotInA);
float3 &ihPivInA = hPivInA.asFloat3();
MDataHandle hPivInB = data.outputValue(ia_pivotInB);
float3 &ihPivInB = hPivInB.asFloat3();
for(int i = 0; i < 3; i++)
{
ihPivInA[i] = pivInA[i];
ihPivInB[i] = pivInB[i];
}
m_constraint->setPivotChanged(false);
}
}
}
else
{ // if not start time, lock position
if(m_constraint)
{
vec3f world;
m_constraint->get_world(world);
fnParentTransform.setTranslation(MVector(world[0], world[1], world[2]), MSpace::kTransform);
}
}
data.setClean(plug);
}
void nailConstraintNode::computeConstraintParam(const MPlug& plug, MDataBlock& data)
{
// std::cout << "nailConstraintNode::computeRigidBodyParam" << std::endl;
MObject thisObject(thisMObject());
MObject update;
MPlug(thisObject, ca_constraint).getValue(update);
if(m_constraint) {
m_constraint->set_damping((float) data.inputValue(ia_damping).asDouble());
}
data.outputValue(ca_constraintParam).set(true);
data.setClean(plug);
}
nail_constraint_t::pointer nailConstraintNode::constraint()
{
// std::cout << "nailConstraintNode::rigid_body" << std::endl;
MObject thisObject(thisMObject());
MObject update;
MPlug(thisObject, ca_constraint).getValue(update);
MPlug(thisObject, ca_constraintParam).getValue(update);
return m_constraint;
}
void nailConstraintNode::update()
{
MObject thisObject(thisMObject());
MObject update;
MPlug(thisObject, ca_constraint).getValue(update);
MPlug(thisObject, ca_constraintParam).getValue(update);
MPlug(thisObject, worldMatrix).elementByLogicalIndex(0).getValue(update);
}

View File

@@ -1,100 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Walt Disney Studios
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Nicola Candussi <nicola@fluidinteractive.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/
//nailConstraintNode.h
#ifndef DYN_NAIL_CONSTRAINT_NODE_H
#define DYN_NAIL_CONSTRAINT_NODE_H
#include <maya/MString.h>
#include <maya/MTypeId.h>
#include <maya/MPxLocatorNode.h>
#include "solver.h"
class nailConstraintNode: public MPxLocatorNode
{
public:
nailConstraintNode();
virtual ~nailConstraintNode();
virtual bool setInternalValueInContext ( const MPlug & plug,
const MDataHandle & dataHandle,
MDGContext & ctx);
// virtual MStatus setDependentsDirty ( const MPlug & plug, MPlugArray & plugArray);
virtual MStatus compute( const MPlug& plug, MDataBlock& data );
virtual void draw( M3dView & view, const MDagPath & path,
M3dView::DisplayStyle style,
M3dView::DisplayStatus status );
virtual bool isBounded() const ;
virtual MBoundingBox boundingBox() const;
virtual bool excludeAsLocator() const { return false; }
virtual bool isTransparent() const { return false; }
static void * creator();
static MStatus initialize();
public:
nail_constraint_t::pointer constraint();
void update();
public:
//Attributes
static MObject ia_rigidBodyA;
static MObject ia_rigidBodyB;
static MObject ia_damping;
static MObject ia_pivotInA;
static MObject ia_pivotInB;
static MObject ca_constraint;
static MObject ca_constraintParam;
public:
static MTypeId typeId;
static MString typeName;
private:
void computeConstraint(const MPlug& plug, MDataBlock& data);
void computeConstraintParam(const MPlug& plug, MDataBlock& data);
void computeWorldMatrix(const MPlug& plug, MDataBlock& data);
public:
static void nodeRemoved(MObject& node, void *clientData);
private:
nail_constraint_t::pointer m_constraint;
};
#endif

View File

@@ -1,124 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Walt Disney Studios
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Nicola Candussi <nicola@fluidinteractive.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/
//nail_constraint.h
#ifndef DYN_NAIL_CONSTRAINT_H
#define DYN_NAIL_CONSTRAINT_H
#include "shared_ptr.h"
#include "rigid_body.h"
#include "mathUtils.h"
#include "constraint.h"
#include "nail_constraint_impl.h"
class nail_constraint_t: public constraint_t
{
public:
//typedefs
typedef shared_ptr<nail_constraint_t> pointer;
//
rigid_body_t::pointer rigid_bodyA() { return m_rigid_bodyA; }
rigid_body_t::pointer rigid_bodyB() { return m_rigid_bodyB; }
//local space pivots
void set_pivotA(vec3f const& p) {
nail_constraint_impl_t* nail_impl = dynamic_cast<nail_constraint_impl_t*>(impl());
nail_impl->set_pivotA(p);
}
void get_pivotA(vec3f& p) const {
nail_constraint_impl_t const* nail_impl = dynamic_cast<nail_constraint_impl_t const*>(impl());
nail_impl->get_pivotA(p);
}
void set_pivotB(vec3f const& p) {
nail_constraint_impl_t* nail_impl = dynamic_cast<nail_constraint_impl_t*>(impl());
nail_impl->set_pivotB(p);
}
void get_pivotB(vec3f& p) const {
nail_constraint_impl_t const* nail_impl = dynamic_cast<nail_constraint_impl_t const*>(impl());
nail_impl->get_pivotB(p);
}
//world space pivots
void get_world_pivotA(vec3f& p) const {
nail_constraint_impl_t const* nail_impl = dynamic_cast<nail_constraint_impl_t const*>(impl());
nail_impl->get_world_pivotA(p);
}
void get_world_pivotB(vec3f& p) const {
nail_constraint_impl_t const* nail_impl = dynamic_cast<nail_constraint_impl_t const*>(impl());
nail_impl->get_world_pivotB(p);
}
//
void set_world(vec3f const& p) {
nail_constraint_impl_t* nail_impl = dynamic_cast<nail_constraint_impl_t*>(impl());
nail_impl->set_world(p);
}
//
void get_world(vec3f& p) const {
nail_constraint_impl_t const* nail_impl = dynamic_cast<nail_constraint_impl_t const*>(impl());
nail_impl->get_world(p);
}
//
void set_damping(float d) {
nail_constraint_impl_t* nail_impl = dynamic_cast<nail_constraint_impl_t*>(impl());
nail_impl->set_damping(d);
}
float damping() const {
nail_constraint_impl_t const* nail_impl = dynamic_cast<nail_constraint_impl_t const*>(impl());
return nail_impl->damping();
}
public:
virtual ~nail_constraint_t() {};
protected:
friend class solver_t;
nail_constraint_t(nail_constraint_impl_t* impl, rigid_body_t::pointer& rigid_bodyA):
constraint_t(impl),
m_rigid_bodyA(rigid_bodyA),
m_rigid_bodyB(NULL)
{
}
nail_constraint_t(nail_constraint_impl_t* impl, rigid_body_t::pointer& rigid_bodyA, rigid_body_t::pointer& rigid_bodyB):
constraint_t(impl),
m_rigid_bodyA(rigid_bodyA),
m_rigid_bodyB(rigid_bodyB)
{
}
private:
rigid_body_t::pointer m_rigid_bodyA;
rigid_body_t::pointer m_rigid_bodyB;
};
#endif

View File

@@ -1,54 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Walt Disney Studios
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Nicola Candussi <nicola@fluidinteractive.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/
//nail_constraint_impl.h
#ifndef DYN_NAIL_CONSTRAINT_IMPL_H
#define DYN_NAIL_CONSTRAINT_IMPL_H
#include "constraint_impl.h"
class nail_constraint_impl_t: public constraint_impl_t
{
public:
//
virtual void set_pivotA(vec3f const& p) = 0;
virtual void get_pivotA(vec3f& p) const = 0;
virtual void set_pivotB(vec3f const& p) = 0;
virtual void get_pivotB(vec3f& p) const = 0;
virtual void set_world(vec3f const& p) = 0;
virtual void get_world(vec3f& p) const = 0;
virtual void get_world_pivotA(vec3f& p) const = 0;
virtual void get_world_pivotB(vec3f& p) const = 0;
//
virtual void set_damping(float d) = 0;
virtual float damping() const = 0;
public:
virtual ~nail_constraint_impl_t() {};
};
#endif

View File

@@ -1,648 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Herbert Law
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Herbert Law <Herbert.Law@gmail.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/
//sixdofConstraintNode.cpp
#include <maya/MFnDependencyNode.h>
#include <maya/MPlugArray.h>
#include <maya/MFnMessageAttribute.h>
#include <maya/MFnNumericAttribute.h>
#include <maya/MFnMatrixAttribute.h>
#include <maya/MMatrix.h>
#include <maya/MFnMatrixData.h>
#include <maya/MFnTransform.h>
#include <maya/MQuaternion.h>
#include <maya/MEulerRotation.h>
#include <maya/MVector.h>
#include "rigidBodyNode.h"
#include "sixdofConstraintNode.h"
#include "mayaUtils.h"
#include "solver.h"
#include "dSolverNode.h"
#include "constraint/bt_sixdof_constraint.h"
MTypeId sixdofConstraintNode::typeId(0x100384);
MString sixdofConstraintNode::typeName("dSixdofConstraint");
MObject sixdofConstraintNode::ia_rigidBodyA;
MObject sixdofConstraintNode::ia_rigidBodyB;
MObject sixdofConstraintNode::ia_damping;
MObject sixdofConstraintNode::ca_constraint;
MObject sixdofConstraintNode::ca_constraintParam;
MObject sixdofConstraintNode::ia_lowerLinLimit;
MObject sixdofConstraintNode::ia_upperLinLimit;
MObject sixdofConstraintNode::ia_lowerAngLimit;
MObject sixdofConstraintNode::ia_upperAngLimit;
MObject sixdofConstraintNode::ia_rotationInA;
MObject sixdofConstraintNode::ia_rotationInB;
MObject sixdofConstraintNode::ia_pivotInA;
MObject sixdofConstraintNode::ia_pivotInB;
MStatus sixdofConstraintNode::initialize()
{
MStatus status;
MFnMessageAttribute fnMsgAttr;
MFnNumericAttribute fnNumericAttr;
MFnMatrixAttribute fnMatrixAttr;
ia_rigidBodyA = fnMsgAttr.create("inRigidBodyA", "inrbA", &status);
MCHECKSTATUS(status, "creating inRigidBodyA attribute")
status = addAttribute(ia_rigidBodyA);
MCHECKSTATUS(status, "adding inRigidBody attribute")
ia_rigidBodyB = fnMsgAttr.create("inRigidBodyB", "inrbB", &status);
MCHECKSTATUS(status, "creating inRigidBodyB attribute")
status = addAttribute(ia_rigidBodyB);
MCHECKSTATUS(status, "adding inRigidBodyB attribute")
ia_damping = fnNumericAttr.create("damping", "dmp", MFnNumericData::kDouble, 1.0, &status);
MCHECKSTATUS(status, "creating damping attribute")
fnNumericAttr.setKeyable(true);
status = addAttribute(ia_damping);
MCHECKSTATUS(status, "adding damping attribute")
ia_lowerLinLimit = fnNumericAttr.createPoint("lowerLinLimit", "lllt", &status);
MCHECKSTATUS(status, "creating lower linear limit attribute")
status = fnNumericAttr.setDefault((double) 0.0, (double) 0.0, (double) 0.0);
fnNumericAttr.setKeyable(true);
status = addAttribute(ia_lowerLinLimit);
MCHECKSTATUS(status, "adding lower linear limit attribute")
ia_upperLinLimit = fnNumericAttr.createPoint("upperLinLimit", "ullt", &status);
MCHECKSTATUS(status, "creating upper linear limit attribute")
status = fnNumericAttr.setDefault((double) 0.0, (double) 0.0, (double) 0.0);
fnNumericAttr.setKeyable(true);
status = addAttribute(ia_upperLinLimit);
MCHECKSTATUS(status, "adding upper linear limit attribute")
ia_lowerAngLimit = fnNumericAttr.createPoint("lowerAngLimit", "lalt", &status);
MCHECKSTATUS(status, "creating lower angular limit attribute")
status = fnNumericAttr.setDefault((double) 0.0, (double) 0.0, (double) 0.0);
fnNumericAttr.setKeyable(true);
status = addAttribute(ia_lowerAngLimit);
MCHECKSTATUS(status, "adding lower angular limit attribute")
ia_upperAngLimit = fnNumericAttr.createPoint("upperAngLimit", "ualt", &status);
MCHECKSTATUS(status, "creating upper angular limit attribute")
status = fnNumericAttr.setDefault((double) 0.0, (double) 0.0, (double) 0.0);
fnNumericAttr.setKeyable(true);
status = addAttribute(ia_upperAngLimit);
MCHECKSTATUS(status, "adding upper angular limit attribute")
ca_constraint = fnNumericAttr.create("ca_constraint", "caco", MFnNumericData::kBoolean, 0, &status);
MCHECKSTATUS(status, "creating ca_constraint attribute")
fnNumericAttr.setConnectable(false);
fnNumericAttr.setHidden(true);
fnNumericAttr.setStorable(false);
fnNumericAttr.setKeyable(false);
status = addAttribute(ca_constraint);
MCHECKSTATUS(status, "adding ca_constraint attribute")
ca_constraintParam = fnNumericAttr.create("ca_constraintParam", "cacop", MFnNumericData::kBoolean, 0, &status);
MCHECKSTATUS(status, "creating ca_constraintParam attribute")
fnNumericAttr.setConnectable(false);
fnNumericAttr.setHidden(true);
fnNumericAttr.setStorable(false);
fnNumericAttr.setKeyable(false);
status = addAttribute(ca_constraintParam);
MCHECKSTATUS(status, "adding ca_constraintParam attribute")
ia_rotationInA = fnNumericAttr.createPoint("rotationInA", "hgRotA", &status);
status = fnNumericAttr.setDefault((double) 0.0, (double) 0.0, (double) 0.0);
MCHECKSTATUS(status, "creating rotationInA attribute")
status = addAttribute(ia_rotationInA);
MCHECKSTATUS(status, "adding rotationInA attribute")
ia_rotationInB = fnNumericAttr.createPoint("rotationInB", "hgRotB", &status);
status = fnNumericAttr.setDefault((double) 0.0, (double) 0.0, (double) 0.0);
MCHECKSTATUS(status, "creating rotationInB attribute")
status = addAttribute(ia_rotationInB);
MCHECKSTATUS(status, "adding rotationInB attribute")
ia_pivotInA = fnNumericAttr.createPoint("pivotInA", "pivinA", &status);
status = fnNumericAttr.setDefault((double) 0.0, (double) 0.0, (double) 0.0);
MCHECKSTATUS(status, "creating pivotInA attribute")
status = addAttribute(ia_pivotInA);
MCHECKSTATUS(status, "adding pivotInA attribute")
ia_pivotInB = fnNumericAttr.createPoint("pivotInB", "pivinB", &status);
status = fnNumericAttr.setDefault((double) 0.0, (double) 0.0, (double) 0.0);
MCHECKSTATUS(status, "creating pivotInB attribute")
status = addAttribute(ia_pivotInB);
MCHECKSTATUS(status, "adding pivotInB attribute")
status = attributeAffects(ia_rigidBodyA, ca_constraint);
MCHECKSTATUS(status, "adding attributeAffects(ia_rigidBodyA, ca_constraint)")
status = attributeAffects(ia_rigidBodyA, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_rigidBodyA, ca_constraintParam)")
status = attributeAffects(ia_rigidBodyB, ca_constraint);
MCHECKSTATUS(status, "adding attributeAffects(ia_rigidBodyB, ca_constraint)")
status = attributeAffects(ia_rigidBodyB, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_rigidBodyB, ca_constraintParam)")
status = attributeAffects(ia_damping, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_damping, ca_constraintParam)")
status = attributeAffects(ia_lowerLinLimit, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_lowerLinLimit, ca_constraintParam)")
status = attributeAffects(ia_upperLinLimit, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_upperLinLimit, ca_constraintParam)")
status = attributeAffects(ia_lowerAngLimit, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_lowerAngLimit, ca_constraintParam)")
status = attributeAffects(ia_upperAngLimit, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_upperAngLimit, ca_constraintParam)")
status = attributeAffects(ia_rotationInA, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_rotationInA, ca_constraintParam)")
status = attributeAffects(ia_rotationInB, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_rotationInB, ca_constraintParam)")
status = attributeAffects(ia_pivotInA, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_pivotInA, ca_constraintParam)")
status = attributeAffects(ia_pivotInB, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_pivotInB, ca_constraintParam)")
return MS::kSuccess;
}
sixdofConstraintNode::sixdofConstraintNode()
{
// std::cout << "sixdofConstraintNode::sixdofConstraintNode" << std::endl;
}
sixdofConstraintNode::~sixdofConstraintNode()
{
// std::cout << "sixdofConstraintNode::~sixdofConstraintNode" << std::endl;
}
void sixdofConstraintNode::nodeRemoved(MObject& node, void *clientData)
{
// std::cout << "sixdofConstraintNode::nodeRemoved" << std::endl;
MFnDependencyNode fnNode(node);
sixdofConstraintNode *pNode = static_cast<sixdofConstraintNode*>(fnNode.userNode());
if (pNode->m_constraint)
{
bt_sixdof_constraint_t* hinge_impl = dynamic_cast<bt_sixdof_constraint_t*>(pNode->m_constraint->pubImpl());
rigid_body_t::pointer rigid_bodyA = pNode->m_constraint->rigid_bodyA();
if(rigid_bodyA)
{
rigid_bodyA->remove_constraint(hinge_impl);
}
rigid_body_t::pointer rigid_bodyB = pNode->m_constraint->rigid_bodyB();
if(rigid_bodyB)
{
rigid_bodyB->remove_constraint(hinge_impl);
}
}
constraint_t::pointer constraint = static_cast<constraint_t::pointer>(pNode->m_constraint);
solver_t::remove_constraint(constraint);
}
void* sixdofConstraintNode::creator()
{
return new sixdofConstraintNode();
}
bool sixdofConstraintNode::setInternalValueInContext ( const MPlug & plug,
const MDataHandle & dataHandle,
MDGContext & ctx)
{
/* if ((plug == pdbFiles) || (plug == ia_scale) || (plug == ia_percent)) {
m_framesDirty = true;
} else if(plug == textureFiles) {
gpufx::m_renderer.setColorTextureDirty();
}*/
return false; //setInternalValueInContext(plug,dataHandle,ctx);
}
MStatus sixdofConstraintNode::compute(const MPlug& plug, MDataBlock& data)
{
//std::cout << "sixdofConstraintNode::compute: " << plug.name() << std::endl;
//MTime time = data.inputValue( sixdofConstraintNode::inTime ).asTime();
if(plug == ca_constraint) {
computeConstraint(plug, data);
} else if(plug == ca_constraintParam) {
computeConstraintParam(plug, data);
} else if(plug.isElement()) {
if(plug.array() == worldMatrix && plug.logicalIndex() == 0) {
computeWorldMatrix(plug, data);
} else {
return MStatus::kUnknownParameter;
}
} else {
return MStatus::kUnknownParameter;
}
return MStatus::kSuccess;
}
void sixdofConstraintNode::draw( M3dView & view, const MDagPath &path,
M3dView::DisplayStyle style,
M3dView::DisplayStatus status )
{
update();
vec3f zeroVec(0.f,0.f,0.f);
vec3f minusXVec(-1.f,0.f,0.f);
vec3f posXVec(1.f,0.f,0.f);
vec3f minusYVec (0.f,-1.f,0.f);
vec3f posYVec (0.f,1.f,0.f);
vec3f minusZVec (0.f,0.f,-1.f);
vec3f posZVec (0.f,0.f,1.f);
view.beginGL();
glPushAttrib( GL_ALL_ATTRIB_BITS );
glDisable(GL_LIGHTING);
if( !(status == M3dView::kActive ||
status == M3dView::kLead ||
status == M3dView::kHilite ||
( style != M3dView::kGouraudShaded && style != M3dView::kFlatShaded )) ) {
glColor3f(1.0, 1.0, 0.0);
}
vec3f posA, posB, pivB;
rigid_body_t::pointer rigid_bodyB = NULL;
if (m_constraint)
{
vec3f pos;
quatf rot;
m_constraint->rigid_bodyA()->get_transform(pos, rot);
m_constraint->worldToA(pos, posA);
rigid_bodyB = m_constraint->rigid_bodyB();
if(rigid_bodyB)
{
rigid_bodyB->get_transform(pos, rot);
m_constraint->worldToA(pos, posB);
}
m_constraint->worldFromB(zeroVec, pos);
m_constraint->worldToA(pos, pivB);
}
glBegin(GL_LINES);
glVertex3f(0.0, 0.0, 0.0);
glVertex3f(posA[0], posA[1], posA[2]);
glVertex3f(0.0, 0.0, 0.0);
glVertex3f(pivB[0], pivB[1], pivB[2]);
if(rigid_bodyB)
{
glVertex3f(pivB[0], pivB[1], pivB[2]);
glVertex3f(posB[0], posB[1], posB[2]);
}
glVertex3f(-1.0, 0.0, 0.0);
glVertex3f(1.0, 0.0, 0.0);
glVertex3f(0.0, -1.0, 0.0);
glVertex3f(0.0, 1.0, 0.0);
glVertex3f(0.0, 0.0, -1.0);
glVertex3f(0.0, 0.0, 1.0);
vec3f posT, posP, posM;
m_constraint->worldFromB(minusXVec, posT);
m_constraint->worldToA(posT, posM);
m_constraint->worldFromB(posXVec, posT);
m_constraint->worldToA(posT, posP);
glVertex3f(posM[0], posM[1], posM[2]);
glVertex3f(posP[0], posP[1], posP[2]);
m_constraint->worldFromB(minusYVec, posT);
m_constraint->worldToA(posT, posM);
m_constraint->worldFromB(posYVec, posT);
m_constraint->worldToA(posT, posP);
glVertex3f(posM[0], posM[1], posM[2]);
glVertex3f(posP[0], posP[1], posP[2]);
m_constraint->worldFromB(minusZVec, posT);
m_constraint->worldToA(posT, posM);
m_constraint->worldFromB(posZVec, posT);
m_constraint->worldToA(posT, posP);
glVertex3f(posM[0], posM[1], posM[2]);
glVertex3f(posP[0], posP[1], posP[2]);
glEnd();
glPopAttrib();
view.endGL();
}
bool sixdofConstraintNode::isBounded() const
{
//return true;
return false;
}
MBoundingBox sixdofConstraintNode::boundingBox() const
{
// std::cout << "sixdofConstraintNode::boundingBox()" << std::endl;
//load the pdbs
MObject node = thisMObject();
MPoint corner1(-1, -1, -1);
MPoint corner2(1, 1, 1);
return MBoundingBox(corner1, corner2);
}
//standard attributes
void sixdofConstraintNode::computeConstraint(const MPlug& plug, MDataBlock& data)
{
// std::cout << "sixdofConstraintNode::computeConstraint" << std::endl;
MObject thisObject(thisMObject());
MPlug plgRigidBodyA(thisObject, ia_rigidBodyA);
MPlug plgRigidBodyB(thisObject, ia_rigidBodyB);
MObject update;
//force evaluation of the rigidBody
plgRigidBodyA.getValue(update);
plgRigidBodyB.getValue(update);
rigid_body_t::pointer rigid_bodyA;
if(plgRigidBodyA.isConnected()) {
MPlugArray connections;
plgRigidBodyA.connectedTo(connections, true, true);
if(connections.length() != 0) {
MFnDependencyNode fnNodeA(connections[0].node());
if(fnNodeA.typeId() == rigidBodyNode::typeId) {
rigidBodyNode *pRigidBodyNodeA = static_cast<rigidBodyNode*>(fnNodeA.userNode());
rigid_bodyA = pRigidBodyNodeA->rigid_body();
} else {
std::cout << "sixdofConstraintNode connected to a non-rigidbody node!" << std::endl;
}
}
}
rigid_body_t::pointer rigid_bodyB;
if(plgRigidBodyB.isConnected()) {
MPlugArray connections;
plgRigidBodyB.connectedTo(connections, true, true);
if(connections.length() != 0) {
MFnDependencyNode fnNodeB(connections[0].node());
if(fnNodeB.typeId() == rigidBodyNode::typeId) {
rigidBodyNode *pRigidBodyNodeB = static_cast<rigidBodyNode*>(fnNodeB.userNode());
rigid_bodyB = pRigidBodyNodeB->rigid_body();
} else {
std::cout << "sixdofConstraintNode connected to a non-rigidbody node!" << std::endl;
}
}
}
vec3f pivInA, pivInB;
if((rigid_bodyA != NULL) && (rigid_bodyB != NULL))
{
constraint_t::pointer constraint = static_cast<constraint_t::pointer>(m_constraint);
solver_t::remove_constraint(constraint);
float3& mPivInA = data.inputValue(ia_pivotInA).asFloat3();
float3& mPivInB = data.inputValue(ia_pivotInB).asFloat3();
for(int i = 0; i < 3; i++)
{
pivInA[i] = (float)mPivInA[i];
pivInB[i] = (float)mPivInB[i];
}
float3& mRotInA = data.inputValue(ia_rotationInA).asFloat3();
MEulerRotation meulerA(deg2rad(mRotInA[0]), deg2rad(mRotInA[1]), deg2rad(mRotInA[2]));
MQuaternion mquatA = meulerA.asQuaternion();
quatf rotA((float)mquatA.w, (float)mquatA.x, (float)mquatA.y, (float)mquatA.z);
float3& mRotInB = data.inputValue(ia_rotationInB).asFloat3();
MEulerRotation meulerB(deg2rad(mRotInB[0]), deg2rad(mRotInB[1]), deg2rad(mRotInB[2]));
MQuaternion mquatB = meulerB.asQuaternion();
quatf rotB((float)mquatB.w, (float)mquatB.x, (float)mquatB.y, (float)mquatB.z);
m_constraint = solver_t::create_sixdof_constraint(rigid_bodyA, pivInA, rotA, rigid_bodyB, pivInB, rotB);
constraint = static_cast<constraint_t::pointer>(m_constraint);
solver_t::add_constraint(constraint);
}
else if(rigid_bodyA != NULL)
{
//not connected to a rigid body, put a default one
constraint_t::pointer constraint = static_cast<constraint_t::pointer>(m_constraint);
solver_t::remove_constraint(constraint);
float3& mPivInA = data.inputValue(ia_pivotInA).asFloat3();
for(int i = 0; i < 3; i++)
{
pivInA[i] = (float)mPivInA[i];
}
float3& mRotInA = data.inputValue(ia_rotationInA).asFloat3();
MEulerRotation meuler(deg2rad(mRotInA[0]), deg2rad(mRotInA[1]), deg2rad(mRotInA[2]));
MQuaternion mquat = meuler.asQuaternion();
quatf rotA((float)mquat.w, (float)mquat.x, (float)mquat.y, (float)mquat.z);
m_constraint = solver_t::create_sixdof_constraint(rigid_bodyA, pivInA, rotA);
constraint = static_cast<constraint_t::pointer>(m_constraint);
solver_t::add_constraint(constraint);
}
data.outputValue(ca_constraint).set(true);
data.setClean(plug);
}
void sixdofConstraintNode::computeWorldMatrix(const MPlug& plug, MDataBlock& data)
{
MObject thisObject(thisMObject());
MFnDagNode fnDagNode(thisObject);
MObject update;
MPlug(thisObject, ca_constraint).getValue(update);
MPlug(thisObject, ca_constraintParam).getValue(update);
MStatus status;
MFnTransform fnParentTransform(fnDagNode.parent(0, &status));
double fixScale[3] = { 1., 1., 1. }; // lock scale
fnParentTransform.setScale(fixScale);
MVector mtranslation = fnParentTransform.getTranslation(MSpace::kTransform, &status);
if(dSolverNode::isStartTime)
{ // allow to edit pivots
MPlug plgRigidBodyA(thisObject, ia_rigidBodyA);
MPlug plgRigidBodyB(thisObject, ia_rigidBodyB);
MObject update;
//force evaluation of the rigidBody
plgRigidBodyA.getValue(update);
if(plgRigidBodyA.isConnected())
{
MPlugArray connections;
plgRigidBodyA.connectedTo(connections, true, true);
if(connections.length() != 0)
{
MFnDependencyNode fnNode(connections[0].node());
if(fnNode.typeId() == rigidBodyNode::typeId)
{
MObject rbAObj = fnNode.object();
rigidBodyNode *pRigidBodyNodeA = static_cast<rigidBodyNode*>(fnNode.userNode());
MPlug(rbAObj, pRigidBodyNodeA->worldMatrix).elementByLogicalIndex(0).getValue(update);
}
}
}
plgRigidBodyB.getValue(update);
if(plgRigidBodyB.isConnected())
{
MPlugArray connections;
plgRigidBodyB.connectedTo(connections, true, true);
if(connections.length() != 0)
{
MFnDependencyNode fnNode(connections[0].node());
if(fnNode.typeId() == rigidBodyNode::typeId)
{
MObject rbBObj = fnNode.object();
rigidBodyNode *pRigidBodyNodeB = static_cast<rigidBodyNode*>(fnNode.userNode());
MPlug(rbBObj, pRigidBodyNodeB->worldMatrix).elementByLogicalIndex(0).getValue(update);
}
}
}
if(m_constraint)
{
MQuaternion mrotation;
fnParentTransform.getRotation(mrotation, MSpace::kTransform);
bool doUpdatePivot = m_constraint->getPivotChanged();
if(!doUpdatePivot)
{
vec3f worldP;
quatf worldR;
m_constraint->get_world(worldP, worldR);
float deltaPX = worldP[0] - float(mtranslation.x);
float deltaPY = worldP[1] - float(mtranslation.y);
float deltaPZ = worldP[2] - float(mtranslation.z);
float deltaRX = (float)mrotation.x - worldR[1];
float deltaRY = (float)mrotation.y - worldR[2];
float deltaRZ = (float)mrotation.z - worldR[3];
float deltaRW = (float)mrotation.w - worldR[0];
float deltaSq = deltaPX * deltaPX + deltaPY * deltaPY + deltaPZ * deltaPZ
+ deltaRX * deltaRX + deltaRY * deltaRY + deltaRZ * deltaRZ + deltaRW * deltaRW;
doUpdatePivot = (deltaSq > FLT_EPSILON);
}
if(doUpdatePivot)
{
m_constraint->set_world(vec3f((float) mtranslation[0], (float) mtranslation[1], (float) mtranslation[2]),
quatf((float)mrotation.w, (float)mrotation.x, (float)mrotation.y, (float)mrotation.z));
vec3f pivInA, pivInB;
quatf rotInA, rotInB;
m_constraint->get_frameA(pivInA, rotInA);
m_constraint->get_frameB(pivInB, rotInB);
MDataHandle hPivInA = data.outputValue(ia_pivotInA);
float3 &ihPivInA = hPivInA.asFloat3();
MDataHandle hPivInB = data.outputValue(ia_pivotInB);
float3 &ihPivInB = hPivInB.asFloat3();
for(int i = 0; i < 3; i++)
{
ihPivInA[i] = pivInA[i];
ihPivInB[i] = pivInB[i];
}
MDataHandle hRotInA = data.outputValue(ia_rotationInA);
float3 &hrotInA = hRotInA.asFloat3();
MQuaternion mrotA(rotInA[1], rotInA[2], rotInA[3], rotInA[0]);
MEulerRotation newrotA(mrotA.asEulerRotation());
hrotInA[0] = rad2deg((float)newrotA.x);
hrotInA[1] = rad2deg((float)newrotA.y);
hrotInA[2] = rad2deg((float)newrotA.z);
MDataHandle hRotInB = data.outputValue(ia_rotationInB);
float3 &hrotInB = hRotInB.asFloat3();
MQuaternion mrotB(rotInB[1], rotInB[2], rotInB[3], rotInB[0]);
MEulerRotation newrotB(mrotB.asEulerRotation());
hrotInB[0] = rad2deg((float)newrotB.x);
hrotInB[1] = rad2deg((float)newrotB.y);
hrotInB[2] = rad2deg((float)newrotB.z);
m_constraint->setPivotChanged(false);
}
}
}
else
{ // if not start time, lock position and rotation
if(m_constraint)
{
vec3f worldP;
quatf worldR;
m_constraint->get_world(worldP, worldR);
fnParentTransform.setTranslation(MVector(worldP[0], worldP[1], worldP[2]), MSpace::kTransform);
fnParentTransform.setRotation(MQuaternion(worldR[1], worldR[2], worldR[3], worldR[0]));
}
}
data.setClean(plug);
}
void sixdofConstraintNode::computeConstraintParam(const MPlug& plug, MDataBlock& data)
{
// std::cout << "sixdofConstraintNode::computeRigidBodyParam" << std::endl;
MObject thisObject(thisMObject());
MObject update;
MPlug(thisObject, ca_constraint).getValue(update);
if(m_constraint) {
m_constraint->set_damping((float) data.inputValue(ia_damping).asDouble());
vec3f lowLin, uppLin, lowAng, uppAng;
float3& mLowLin = data.inputValue(ia_lowerLinLimit).asFloat3();
float3& mUppLin = data.inputValue(ia_upperLinLimit).asFloat3();
float3& mLowAng = data.inputValue(ia_lowerAngLimit).asFloat3();
float3& mUppAng = data.inputValue(ia_upperAngLimit).asFloat3();
for(int j = 0; j < 3; j++)
{
lowLin[j] = mLowLin[j];
uppLin[j] = mUppLin[j];
lowAng[j] = deg2rad(mLowAng[j]);
uppAng[j] = deg2rad(mUppAng[j]);
}
m_constraint->set_LinLimit(lowLin, uppLin);
m_constraint->set_AngLimit(lowAng, uppAng);
}
data.outputValue(ca_constraintParam).set(true);
data.setClean(plug);
}
sixdof_constraint_t::pointer sixdofConstraintNode::constraint()
{
// std::cout << "sixdofConstraintNode::rigid_body" << std::endl;
MObject thisObject(thisMObject());
MObject update;
MPlug(thisObject, ca_constraint).getValue(update);
MPlug(thisObject, ca_constraintParam).getValue(update);
return m_constraint;
}
void sixdofConstraintNode::update()
{
MObject thisObject(thisMObject());
MObject update;
MPlug(thisObject, ca_constraint).getValue(update);
MPlug(thisObject, ca_constraintParam).getValue(update);
MPlug(thisObject, worldMatrix).elementByLogicalIndex(0).getValue(update);
}

View File

@@ -1,110 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Herbert Law
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Herbert Law <Herbert.Law@gmail.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/
//sixdofConstraintNode.h
#ifndef DYN_SIXDOF_CONSTRAINT_NODE_H
#define DYN_SIXDOF_CONSTRAINT_NODE_H
#include <maya/MString.h>
#include <maya/MTypeId.h>
#include <maya/MPxLocatorNode.h>
#include "solver.h"
class sixdofConstraintNode: public MPxLocatorNode
{
public:
sixdofConstraintNode();
virtual ~sixdofConstraintNode();
virtual bool setInternalValueInContext ( const MPlug & plug,
const MDataHandle & dataHandle,
MDGContext & ctx);
// virtual MStatus setDependentsDirty ( const MPlug & plug, MPlugArray & plugArray);
virtual MStatus compute( const MPlug& plug, MDataBlock& data );
virtual void draw( M3dView & view, const MDagPath & path,
M3dView::DisplayStyle style,
M3dView::DisplayStatus status );
virtual bool isBounded() const ;
virtual MBoundingBox boundingBox() const;
virtual bool excludeAsLocator() const { return false; }
virtual bool isTransparent() const { return false; }
static void * creator();
static MStatus initialize();
public:
sixdof_constraint_t::pointer constraint();
void update();
public:
//Attributes
static MObject ia_rigidBodyA;
static MObject ia_rigidBodyB;
static MObject ia_damping;
static MObject ia_lowerLinLimit;
static MObject ia_upperLinLimit;
static MObject ia_lowerAngLimit;
static MObject ia_upperAngLimit;
static MObject ia_rotationInA;
static MObject ia_rotationInB;
static MObject ia_pivotInA;
static MObject ia_pivotInB;
static MObject ca_constraint;
static MObject ca_constraintParam;
public:
static MTypeId typeId;
static MString typeName;
private:
void computeConstraint(const MPlug& plug, MDataBlock& data);
void computeConstraintParam(const MPlug& plug, MDataBlock& data);
void computeWorldMatrix(const MPlug& plug, MDataBlock& data);
public:
static void nodeRemoved(MObject& node, void *clientData);
private:
sixdof_constraint_t::pointer m_constraint;
};
#endif //DYN_SIXDOF_CONSTRAINT_NODE_H

View File

@@ -1,133 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Herbert Law
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Herbert Law <Herbert.Law@gmail.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/
//sixdof_constraint.h
#ifndef DYN_SIXDOF_CONSTRAINT_H
#define DYN_SIXDOF_CONSTRAINT_H
#include "shared_ptr.h"
#include "rigid_body.h"
#include "mathUtils.h"
#include "constraint.h"
#include "sixdof_constraint_impl.h"
class sixdof_constraint_t: public constraint_t
{
public:
//typedefs
typedef shared_ptr<sixdof_constraint_t> pointer;
//
rigid_body_t::pointer rigid_bodyA() { return m_rigid_bodyA; }
rigid_body_t::pointer rigid_bodyB() { return m_rigid_bodyB; }
//
void set_damping(float d) {
sixdof_constraint_impl_t* sixdof_impl = dynamic_cast<sixdof_constraint_impl_t*>(impl());
sixdof_impl->set_damping(d);
}
float damping() const {
sixdof_constraint_impl_t const* sixdof_impl = dynamic_cast<sixdof_constraint_impl_t const*>(impl());
return sixdof_impl->damping();
}
void set_LinLimit(vec3f& lower, vec3f& upper) {
sixdof_constraint_impl_t* sixdof_impl = dynamic_cast<sixdof_constraint_impl_t*>(impl());
sixdof_impl->set_LinLimit(lower, upper);
}
void set_AngLimit(vec3f& lower, vec3f& upper) {
sixdof_constraint_impl_t* sixdof_impl = dynamic_cast<sixdof_constraint_impl_t*>(impl());
sixdof_impl->set_AngLimit(lower, upper);
}
void get_frameA(vec3f& p, quatf& r) const {
sixdof_constraint_impl_t const* sixdof_impl = dynamic_cast<sixdof_constraint_impl_t const*>(impl());
sixdof_impl->get_frameA(p, r);
}
void get_frameB(vec3f& p, quatf& r) const {
sixdof_constraint_impl_t const* sixdof_impl = dynamic_cast<sixdof_constraint_impl_t const*>(impl());
sixdof_impl->get_frameB(p, r);
}
void get_invFrameA(vec3f& p, quatf& r) const {
sixdof_constraint_impl_t const* sixdof_impl = dynamic_cast<sixdof_constraint_impl_t const*>(impl());
sixdof_impl->get_invFrameA(p, r);
}
void get_invFrameB(vec3f& p, quatf& r) const {
sixdof_constraint_impl_t const* sixdof_impl = dynamic_cast<sixdof_constraint_impl_t const*>(impl());
sixdof_impl->get_invFrameB(p, r);
}
void worldToA(vec3f& w, vec3f& p) const {
sixdof_constraint_impl_t const* sixdof_impl = dynamic_cast<sixdof_constraint_impl_t const*>(impl());
sixdof_impl->worldToA(w, p);
}
void worldFromB(vec3f& p, vec3f& w) const {
sixdof_constraint_impl_t const* sixdof_impl = dynamic_cast<sixdof_constraint_impl_t const*>(impl());
sixdof_impl->worldFromB(p, w);
}
void set_world(vec3f const& p, quatf const& r)
{
sixdof_constraint_impl_t* sixdof_impl = dynamic_cast<sixdof_constraint_impl_t*>(impl());
sixdof_impl->set_world(p, r);
}
//local space pivot
void get_world(vec3f& p, quatf& r) const {
sixdof_constraint_impl_t const* sixdof_impl = dynamic_cast<sixdof_constraint_impl_t const*>(impl());
sixdof_impl->get_world(p, r);
}
public:
virtual ~sixdof_constraint_t() {};
protected:
friend class solver_t;
sixdof_constraint_t(sixdof_constraint_impl_t* impl, rigid_body_t::pointer& rigid_body):
constraint_t(impl),
m_rigid_bodyA(rigid_body)
{
}
sixdof_constraint_t(sixdof_constraint_impl_t* impl, rigid_body_t::pointer& rigid_bodyA, rigid_body_t::pointer& rigid_bodyB):
constraint_t(impl),
m_rigid_bodyA(rigid_bodyA),
m_rigid_bodyB(rigid_bodyB)
{
}
private:
rigid_body_t::pointer m_rigid_bodyA;
rigid_body_t::pointer m_rigid_bodyB;
};
#endif //DYN_SIXDOF_CONSTRAINT_H

View File

@@ -1,55 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Herbert Law
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Herbert Law <Herbert.Law@gmail.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/
//sixdof_constraint_impl.h
#ifndef DYN_SIXDOF_CONSTRAINT_IMPL_H
#define DYN_SIXDOF_CONSTRAINT_IMPL_H
#include "constraint_impl.h"
class sixdof_constraint_impl_t: public constraint_impl_t
{
public:
virtual void set_world(vec3f const& p, quatf const& r) = 0;
virtual void get_world(vec3f& p, quatf& r) const = 0;
virtual void get_frameA(vec3f& p, quatf& r) const = 0;
virtual void get_frameB(vec3f& p, quatf& r) const = 0;
virtual void get_invFrameA(vec3f& p, quatf& r) const = 0;
virtual void get_invFrameB(vec3f& p, quatf& r) const = 0;
virtual void worldToA(vec3f& w, vec3f& p) const = 0;
virtual void worldFromB(vec3f& p, vec3f& w) const = 0;
//
virtual void set_damping(float d) = 0;
virtual float damping() const = 0;
virtual void set_LinLimit(vec3f& lower, vec3f& upper) = 0;
virtual void set_AngLimit(vec3f& lower, vec3f& upper) = 0;
public:
virtual ~sixdof_constraint_impl_t() {};
};
#endif //DYN_SIXDOF_CONSTRAINT_IMPL_H

View File

@@ -1,635 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Herbert Law
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Herbert Law <Herbert.Law@gmail.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/
//sliderConstraintNode.cpp
#include <maya/MFnDependencyNode.h>
#include <maya/MPlugArray.h>
#include <maya/MFnMessageAttribute.h>
#include <maya/MFnNumericAttribute.h>
#include <maya/MFnMatrixAttribute.h>
#include <maya/MMatrix.h>
#include <maya/MFnMatrixData.h>
#include <maya/MFnTransform.h>
#include <maya/MQuaternion.h>
#include <maya/MEulerRotation.h>
#include <maya/MVector.h>
#include "rigidBodyNode.h"
#include "sliderConstraintNode.h"
#include "mayaUtils.h"
#include "solver.h"
#include "dSolverNode.h"
#include "constraint/bt_slider_constraint.h"
MTypeId sliderConstraintNode::typeId(0x100385);
MString sliderConstraintNode::typeName("dSliderConstraint");
MObject sliderConstraintNode::ia_rigidBodyA;
MObject sliderConstraintNode::ia_rigidBodyB;
MObject sliderConstraintNode::ia_damping;
MObject sliderConstraintNode::ca_constraint;
MObject sliderConstraintNode::ca_constraintParam;
MObject sliderConstraintNode::ia_lowerLinLimit;
MObject sliderConstraintNode::ia_upperLinLimit;
MObject sliderConstraintNode::ia_lowerAngLimit;
MObject sliderConstraintNode::ia_upperAngLimit;
MObject sliderConstraintNode::ia_rotationInA;
MObject sliderConstraintNode::ia_rotationInB;
MObject sliderConstraintNode::ia_pivotInA;
MObject sliderConstraintNode::ia_pivotInB;
MStatus sliderConstraintNode::initialize()
{
MStatus status;
MFnMessageAttribute fnMsgAttr;
MFnNumericAttribute fnNumericAttr;
MFnMatrixAttribute fnMatrixAttr;
ia_rigidBodyA = fnMsgAttr.create("inRigidBodyA", "inrbA", &status);
MCHECKSTATUS(status, "creating inRigidBodyA attribute")
status = addAttribute(ia_rigidBodyA);
MCHECKSTATUS(status, "adding inRigidBody attribute")
ia_rigidBodyB = fnMsgAttr.create("inRigidBodyB", "inrbB", &status);
MCHECKSTATUS(status, "creating inRigidBodyB attribute")
status = addAttribute(ia_rigidBodyB);
MCHECKSTATUS(status, "adding inRigidBodyB attribute")
ia_damping = fnNumericAttr.create("damping", "dmp", MFnNumericData::kDouble, 1.0, &status);
MCHECKSTATUS(status, "creating damping attribute")
fnNumericAttr.setKeyable(true);
status = addAttribute(ia_damping);
MCHECKSTATUS(status, "adding damping attribute")
ia_lowerLinLimit = fnNumericAttr.create("lowerLinLimit", "lllt", MFnNumericData::kDouble, 1, &status);
MCHECKSTATUS(status, "creating lower linear limit attribute")
fnNumericAttr.setKeyable(true);
status = addAttribute(ia_lowerLinLimit);
MCHECKSTATUS(status, "adding lower linear limit attribute")
ia_upperLinLimit = fnNumericAttr.create("upperLinLimit", "ullt", MFnNumericData::kDouble, -1, &status);
MCHECKSTATUS(status, "creating upper linear limit attribute")
fnNumericAttr.setKeyable(true);
status = addAttribute(ia_upperLinLimit);
MCHECKSTATUS(status, "adding upper linear limit attribute")
ia_lowerAngLimit = fnNumericAttr.create("lowerAngLimit", "lalt", MFnNumericData::kDouble, 0, &status);
MCHECKSTATUS(status, "creating lower angular limit attribute")
fnNumericAttr.setKeyable(true);
status = addAttribute(ia_lowerAngLimit);
MCHECKSTATUS(status, "adding lower angular limit attribute")
ia_upperAngLimit = fnNumericAttr.create("upperAngLimit", "ualt", MFnNumericData::kDouble, 0, &status);
MCHECKSTATUS(status, "creating upper angular limit attribute")
fnNumericAttr.setKeyable(true);
status = addAttribute(ia_upperAngLimit);
MCHECKSTATUS(status, "adding upper angular limit attribute")
ca_constraint = fnNumericAttr.create("ca_constraint", "caco", MFnNumericData::kBoolean, 0, &status);
MCHECKSTATUS(status, "creating ca_constraint attribute")
fnNumericAttr.setConnectable(false);
fnNumericAttr.setHidden(true);
fnNumericAttr.setStorable(false);
fnNumericAttr.setKeyable(false);
status = addAttribute(ca_constraint);
MCHECKSTATUS(status, "adding ca_constraint attribute")
ca_constraintParam = fnNumericAttr.create("ca_constraintParam", "cacop", MFnNumericData::kBoolean, 0, &status);
MCHECKSTATUS(status, "creating ca_constraintParam attribute")
fnNumericAttr.setConnectable(false);
fnNumericAttr.setHidden(true);
fnNumericAttr.setStorable(false);
fnNumericAttr.setKeyable(false);
status = addAttribute(ca_constraintParam);
MCHECKSTATUS(status, "adding ca_constraintParam attribute")
ia_rotationInA = fnNumericAttr.createPoint("rotationInA", "hgRotA", &status);
status = fnNumericAttr.setDefault((double) 0.0, (double) 0.0, (double) 0.0);
MCHECKSTATUS(status, "creating rotationInA attribute")
status = addAttribute(ia_rotationInA);
MCHECKSTATUS(status, "adding rotationInA attribute")
ia_rotationInB = fnNumericAttr.createPoint("rotationInB", "hgRotB", &status);
status = fnNumericAttr.setDefault((double) 0.0, (double) 0.0, (double) 0.0);
MCHECKSTATUS(status, "creating rotationInB attribute")
status = addAttribute(ia_rotationInB);
MCHECKSTATUS(status, "adding rotationInB attribute")
ia_pivotInA = fnNumericAttr.createPoint("pivotInA", "pivinA", &status);
status = fnNumericAttr.setDefault((double) 0.0, (double) 0.0, (double) 0.0);
MCHECKSTATUS(status, "creating pivotInA attribute")
status = addAttribute(ia_pivotInA);
MCHECKSTATUS(status, "adding pivotInA attribute")
ia_pivotInB = fnNumericAttr.createPoint("pivotInB", "pivinB", &status);
status = fnNumericAttr.setDefault((double) 0.0, (double) 0.0, (double) 0.0);
MCHECKSTATUS(status, "creating pivotInB attribute")
status = addAttribute(ia_pivotInB);
MCHECKSTATUS(status, "adding pivotInB attribute")
status = attributeAffects(ia_rigidBodyA, ca_constraint);
MCHECKSTATUS(status, "adding attributeAffects(ia_rigidBodyA, ca_constraint)")
status = attributeAffects(ia_rigidBodyA, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_rigidBodyA, ca_constraintParam)")
status = attributeAffects(ia_rigidBodyB, ca_constraint);
MCHECKSTATUS(status, "adding attributeAffects(ia_rigidBodyB, ca_constraint)")
status = attributeAffects(ia_rigidBodyB, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_rigidBodyB, ca_constraintParam)")
status = attributeAffects(ia_damping, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_damping, ca_constraintParam)")
status = attributeAffects(ia_lowerLinLimit, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_lowerLinLimit, ca_constraintParam)")
status = attributeAffects(ia_upperLinLimit, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_upperLinLimit, ca_constraintParam)")
status = attributeAffects(ia_lowerAngLimit, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_lowerAngLimit, ca_constraintParam)")
status = attributeAffects(ia_upperAngLimit, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_upperAngLimit, ca_constraintParam)")
status = attributeAffects(ia_rotationInA, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_rotationInA, ca_constraintParam)")
status = attributeAffects(ia_rotationInB, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_rotationInB, ca_constraintParam)")
status = attributeAffects(ia_pivotInA, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_pivotInA, ca_constraintParam)")
status = attributeAffects(ia_pivotInB, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_pivotInB, ca_constraintParam)")
return MS::kSuccess;
}
sliderConstraintNode::sliderConstraintNode()
{
// std::cout << "sliderConstraintNode::sliderConstraintNode" << std::endl;
}
sliderConstraintNode::~sliderConstraintNode()
{
// std::cout << "sliderConstraintNode::~sliderConstraintNode" << std::endl;
}
void sliderConstraintNode::nodeRemoved(MObject& node, void *clientData)
{
// std::cout << "sliderConstraintNode::nodeRemoved" << std::endl;
MFnDependencyNode fnNode(node);
sliderConstraintNode *pNode = static_cast<sliderConstraintNode*>(fnNode.userNode());
if (pNode->m_constraint)
{
bt_slider_constraint_t* hinge_impl = dynamic_cast<bt_slider_constraint_t*>(pNode->m_constraint->pubImpl());
rigid_body_t::pointer rigid_bodyA = pNode->m_constraint->rigid_bodyA();
if(rigid_bodyA)
{
rigid_bodyA->remove_constraint(hinge_impl);
}
rigid_body_t::pointer rigid_bodyB = pNode->m_constraint->rigid_bodyB();
if(rigid_bodyB)
{
rigid_bodyB->remove_constraint(hinge_impl);
}
}
constraint_t::pointer constraint = static_cast<constraint_t::pointer>(pNode->m_constraint);
solver_t::remove_constraint(constraint);
}
void* sliderConstraintNode::creator()
{
return new sliderConstraintNode();
}
bool sliderConstraintNode::setInternalValueInContext ( const MPlug & plug,
const MDataHandle & dataHandle,
MDGContext & ctx)
{
/* if ((plug == pdbFiles) || (plug == ia_scale) || (plug == ia_percent)) {
m_framesDirty = true;
} else if(plug == textureFiles) {
gpufx::m_renderer.setColorTextureDirty();
}*/
return false; //setInternalValueInContext(plug,dataHandle,ctx);
}
MStatus sliderConstraintNode::compute(const MPlug& plug, MDataBlock& data)
{
//std::cout << "sliderConstraintNode::compute: " << plug.name() << std::endl;
//MTime time = data.inputValue( sliderConstraintNode::inTime ).asTime();
if(plug == ca_constraint) {
computeConstraint(plug, data);
} else if(plug == ca_constraintParam) {
computeConstraintParam(plug, data);
} else if(plug.isElement()) {
if(plug.array() == worldMatrix && plug.logicalIndex() == 0) {
computeWorldMatrix(plug, data);
} else {
return MStatus::kUnknownParameter;
}
} else {
return MStatus::kUnknownParameter;
}
return MStatus::kSuccess;
}
void sliderConstraintNode::draw( M3dView & view, const MDagPath &path,
M3dView::DisplayStyle style,
M3dView::DisplayStatus status )
{
update();
vec3f zeroVec(0.f,0.f,0.f);
vec3f minusXVec(-1.f,0.f,0.f);
vec3f posXVec(1.f,0.f,0.f);
vec3f minusYVec (0.f,-1.f,0.f);
vec3f posYVec (0.f,1.f,0.f);
vec3f minusZVec (0.f,0.f,-1.f);
vec3f posZVec (0.f,0.f,1.f);
view.beginGL();
glPushAttrib( GL_ALL_ATTRIB_BITS );
glDisable(GL_LIGHTING);
if( !(status == M3dView::kActive ||
status == M3dView::kLead ||
status == M3dView::kHilite ||
( style != M3dView::kGouraudShaded && style != M3dView::kFlatShaded )) ) {
glColor3f(1.0, 1.0, 0.0);
}
vec3f posA, posB, pivB;
rigid_body_t::pointer rigid_bodyB = NULL;
if (m_constraint)
{
vec3f pos;
quatf rot;
m_constraint->rigid_bodyA()->get_transform(pos, rot);
m_constraint->worldToA(pos, posA);
rigid_bodyB = m_constraint->rigid_bodyB();
if(rigid_bodyB)
{
rigid_bodyB->get_transform(pos, rot);
m_constraint->worldToA(pos, posB);
}
m_constraint->worldFromB(zeroVec, pos);
m_constraint->worldToA(pos, pivB);
}
glBegin(GL_LINES);
glVertex3f(0.0, 0.0, 0.0);
glVertex3f(posA[0], posA[1], posA[2]);
glVertex3f(0.0, 0.0, 0.0);
glVertex3f(pivB[0], pivB[1], pivB[2]);
if(rigid_bodyB)
{
glVertex3f(pivB[0], pivB[1], pivB[2]);
glVertex3f(posB[0], posB[1], posB[2]);
}
glVertex3f(-1.0, 0.0, 0.0);
glVertex3f(1.0, 0.0, 0.0);
glVertex3f(0.0, -1.0, 0.0);
glVertex3f(0.0, 1.0, 0.0);
glVertex3f(0.0, 0.0, -1.0);
glVertex3f(0.0, 0.0, 1.0);
vec3f posT, posP, posM;
m_constraint->worldFromB(minusXVec, posT);
m_constraint->worldToA(posT, posM);
m_constraint->worldFromB(posXVec, posT);
m_constraint->worldToA(posT, posP);
glVertex3f(posM[0], posM[1], posM[2]);
glVertex3f(posP[0], posP[1], posP[2]);
m_constraint->worldFromB(minusYVec, posT);
m_constraint->worldToA(posT, posM);
m_constraint->worldFromB(posYVec, posT);
m_constraint->worldToA(posT, posP);
glVertex3f(posM[0], posM[1], posM[2]);
glVertex3f(posP[0], posP[1], posP[2]);
m_constraint->worldFromB(minusZVec, posT);
m_constraint->worldToA(posT, posM);
m_constraint->worldFromB(posZVec, posT);
m_constraint->worldToA(posT, posP);
glVertex3f(posM[0], posM[1], posM[2]);
glVertex3f(posP[0], posP[1], posP[2]);
glEnd();
glPopAttrib();
view.endGL();
}
bool sliderConstraintNode::isBounded() const
{
//return true;
return false;
}
MBoundingBox sliderConstraintNode::boundingBox() const
{
// std::cout << "sliderConstraintNode::boundingBox()" << std::endl;
//load the pdbs
MObject node = thisMObject();
MPoint corner1(-1, -1, -1);
MPoint corner2(1, 1, 1);
return MBoundingBox(corner1, corner2);
}
//standard attributes
void sliderConstraintNode::computeConstraint(const MPlug& plug, MDataBlock& data)
{
// std::cout << "sliderConstraintNode::computeConstraint" << std::endl;
MObject thisObject(thisMObject());
MPlug plgRigidBodyA(thisObject, ia_rigidBodyA);
MPlug plgRigidBodyB(thisObject, ia_rigidBodyB);
MObject update;
//force evaluation of the rigidBody
plgRigidBodyA.getValue(update);
plgRigidBodyB.getValue(update);
rigid_body_t::pointer rigid_bodyA;
if(plgRigidBodyA.isConnected()) {
MPlugArray connections;
plgRigidBodyA.connectedTo(connections, true, true);
if(connections.length() != 0) {
MFnDependencyNode fnNodeA(connections[0].node());
if(fnNodeA.typeId() == rigidBodyNode::typeId) {
rigidBodyNode *pRigidBodyNodeA = static_cast<rigidBodyNode*>(fnNodeA.userNode());
rigid_bodyA = pRigidBodyNodeA->rigid_body();
} else {
std::cout << "sliderConstraintNode connected to a non-rigidbody node!" << std::endl;
}
}
}
rigid_body_t::pointer rigid_bodyB;
if(plgRigidBodyB.isConnected()) {
MPlugArray connections;
plgRigidBodyB.connectedTo(connections, true, true);
if(connections.length() != 0) {
MFnDependencyNode fnNodeB(connections[0].node());
if(fnNodeB.typeId() == rigidBodyNode::typeId) {
rigidBodyNode *pRigidBodyNodeB = static_cast<rigidBodyNode*>(fnNodeB.userNode());
rigid_bodyB = pRigidBodyNodeB->rigid_body();
} else {
std::cout << "sliderConstraintNode connected to a non-rigidbody node!" << std::endl;
}
}
}
vec3f pivInA, pivInB;
if((rigid_bodyA != NULL) && (rigid_bodyB != NULL))
{
constraint_t::pointer constraint = static_cast<constraint_t::pointer>(m_constraint);
solver_t::remove_constraint(constraint);
float3& mPivInA = data.inputValue(ia_pivotInA).asFloat3();
float3& mPivInB = data.inputValue(ia_pivotInB).asFloat3();
for(int i = 0; i < 3; i++)
{
pivInA[i] = (float)mPivInA[i];
pivInB[i] = (float)mPivInB[i];
}
float3& mRotInA = data.inputValue(ia_rotationInA).asFloat3();
MEulerRotation meulerA(deg2rad(mRotInA[0]), deg2rad(mRotInA[1]), deg2rad(mRotInA[2]));
MQuaternion mquatA = meulerA.asQuaternion();
quatf rotA((float)mquatA.w, (float)mquatA.x, (float)mquatA.y, (float)mquatA.z);
float3& mRotInB = data.inputValue(ia_rotationInB).asFloat3();
MEulerRotation meulerB(deg2rad(mRotInB[0]), deg2rad(mRotInB[1]), deg2rad(mRotInB[2]));
MQuaternion mquatB = meulerB.asQuaternion();
quatf rotB((float)mquatB.w, (float)mquatB.x, (float)mquatB.y, (float)mquatB.z);
m_constraint = solver_t::create_slider_constraint(rigid_bodyA, pivInA, rotA, rigid_bodyB, pivInB, rotB);
constraint = static_cast<constraint_t::pointer>(m_constraint);
solver_t::add_constraint(constraint);
}
else if(rigid_bodyA != NULL)
{
//not connected to a rigid body, put a default one
constraint_t::pointer constraint = static_cast<constraint_t::pointer>(m_constraint);
solver_t::remove_constraint(constraint);
float3& mPivInA = data.inputValue(ia_pivotInA).asFloat3();
for(int i = 0; i < 3; i++)
{
pivInA[i] = (float)mPivInA[i];
}
float3& mRotInA = data.inputValue(ia_rotationInA).asFloat3();
MEulerRotation meuler(deg2rad(mRotInA[0]), deg2rad(mRotInA[1]), deg2rad(mRotInA[2]));
MQuaternion mquat = meuler.asQuaternion();
quatf rotA((float)mquat.w, (float)mquat.x, (float)mquat.y, (float)mquat.z);
m_constraint = solver_t::create_slider_constraint(rigid_bodyA, pivInA, rotA);
constraint = static_cast<constraint_t::pointer>(m_constraint);
solver_t::add_constraint(constraint);
}
data.outputValue(ca_constraint).set(true);
data.setClean(plug);
}
void sliderConstraintNode::computeWorldMatrix(const MPlug& plug, MDataBlock& data)
{
MObject thisObject(thisMObject());
MFnDagNode fnDagNode(thisObject);
MObject update;
MPlug(thisObject, ca_constraint).getValue(update);
MPlug(thisObject, ca_constraintParam).getValue(update);
MStatus status;
MFnTransform fnParentTransform(fnDagNode.parent(0, &status));
double fixScale[3] = { 1., 1., 1. }; // lock scale
fnParentTransform.setScale(fixScale);
MVector mtranslation = fnParentTransform.getTranslation(MSpace::kTransform, &status);
if(dSolverNode::isStartTime)
{ // allow to edit pivots
MPlug plgRigidBodyA(thisObject, ia_rigidBodyA);
MPlug plgRigidBodyB(thisObject, ia_rigidBodyB);
MObject update;
//force evaluation of the rigidBody
plgRigidBodyA.getValue(update);
if(plgRigidBodyA.isConnected())
{
MPlugArray connections;
plgRigidBodyA.connectedTo(connections, true, true);
if(connections.length() != 0)
{
MFnDependencyNode fnNode(connections[0].node());
if(fnNode.typeId() == rigidBodyNode::typeId)
{
MObject rbAObj = fnNode.object();
rigidBodyNode *pRigidBodyNodeA = static_cast<rigidBodyNode*>(fnNode.userNode());
MPlug(rbAObj, pRigidBodyNodeA->worldMatrix).elementByLogicalIndex(0).getValue(update);
}
}
}
plgRigidBodyB.getValue(update);
if(plgRigidBodyB.isConnected())
{
MPlugArray connections;
plgRigidBodyB.connectedTo(connections, true, true);
if(connections.length() != 0)
{
MFnDependencyNode fnNode(connections[0].node());
if(fnNode.typeId() == rigidBodyNode::typeId)
{
MObject rbBObj = fnNode.object();
rigidBodyNode *pRigidBodyNodeB = static_cast<rigidBodyNode*>(fnNode.userNode());
MPlug(rbBObj, pRigidBodyNodeB->worldMatrix).elementByLogicalIndex(0).getValue(update);
}
}
}
if(m_constraint)
{
MQuaternion mrotation;
fnParentTransform.getRotation(mrotation, MSpace::kTransform);
bool doUpdatePivot = m_constraint->getPivotChanged();
if(!doUpdatePivot)
{
vec3f worldP;
quatf worldR;
m_constraint->get_world(worldP, worldR);
float deltaPX = worldP[0] - float(mtranslation.x);
float deltaPY = worldP[1] - float(mtranslation.y);
float deltaPZ = worldP[2] - float(mtranslation.z);
float deltaRX = (float)mrotation.x - worldR[1];
float deltaRY = (float)mrotation.y - worldR[2];
float deltaRZ = (float)mrotation.z - worldR[3];
float deltaRW = (float)mrotation.w - worldR[0];
float deltaSq = deltaPX * deltaPX + deltaPY * deltaPY + deltaPZ * deltaPZ
+ deltaRX * deltaRX + deltaRY * deltaRY + deltaRZ * deltaRZ + deltaRW * deltaRW;
doUpdatePivot = (deltaSq > FLT_EPSILON);
}
if(doUpdatePivot)
{
m_constraint->set_world(vec3f((float) mtranslation[0], (float) mtranslation[1], (float) mtranslation[2]),
quatf((float)mrotation.w, (float)mrotation.x, (float)mrotation.y, (float)mrotation.z));
vec3f pivInA, pivInB;
quatf rotInA, rotInB;
m_constraint->get_frameA(pivInA, rotInA);
m_constraint->get_frameB(pivInB, rotInB);
MDataHandle hPivInA = data.outputValue(ia_pivotInA);
float3 &ihPivInA = hPivInA.asFloat3();
MDataHandle hPivInB = data.outputValue(ia_pivotInB);
float3 &ihPivInB = hPivInB.asFloat3();
for(int i = 0; i < 3; i++)
{
ihPivInA[i] = pivInA[i];
ihPivInB[i] = pivInB[i];
}
MDataHandle hRotInA = data.outputValue(ia_rotationInA);
float3 &hrotInA = hRotInA.asFloat3();
MQuaternion mrotA(rotInA[1], rotInA[2], rotInA[3], rotInA[0]);
MEulerRotation newrotA(mrotA.asEulerRotation());
hrotInA[0] = rad2deg((float)newrotA.x);
hrotInA[1] = rad2deg((float)newrotA.y);
hrotInA[2] = rad2deg((float)newrotA.z);
MDataHandle hRotInB = data.outputValue(ia_rotationInB);
float3 &hrotInB = hRotInB.asFloat3();
MQuaternion mrotB(rotInB[1], rotInB[2], rotInB[3], rotInB[0]);
MEulerRotation newrotB(mrotB.asEulerRotation());
hrotInB[0] = rad2deg((float)newrotB.x);
hrotInB[1] = rad2deg((float)newrotB.y);
hrotInB[2] = rad2deg((float)newrotB.z);
m_constraint->setPivotChanged(false);
}
}
}
else
{ // if not start time, lock position and rotation
if(m_constraint)
{
vec3f worldP;
quatf worldR;
m_constraint->get_world(worldP, worldR);
fnParentTransform.setTranslation(MVector(worldP[0], worldP[1], worldP[2]), MSpace::kTransform);
fnParentTransform.setRotation(MQuaternion(worldR[1], worldR[2], worldR[3], worldR[0]));
}
}
data.setClean(plug);
}
void sliderConstraintNode::computeConstraintParam(const MPlug& plug, MDataBlock& data)
{
// std::cout << "sliderConstraintNode::computeRigidBodyParam" << std::endl;
MObject thisObject(thisMObject());
MObject update;
MPlug(thisObject, ca_constraint).getValue(update);
if(m_constraint) {
m_constraint->set_damping((float) data.inputValue(ia_damping).asDouble());
float lin_lower = (float) data.inputValue(ia_lowerLinLimit).asDouble();
float lin_upper = (float) data.inputValue(ia_upperLinLimit).asDouble();
m_constraint->set_LinLimit(lin_lower, lin_upper);
float ang_lower = (float) data.inputValue(ia_lowerAngLimit).asDouble();
float ang_upper = (float) data.inputValue(ia_upperAngLimit).asDouble();
m_constraint->set_AngLimit(deg2rad(ang_lower), deg2rad(ang_upper));
}
data.outputValue(ca_constraintParam).set(true);
data.setClean(plug);
}
slider_constraint_t::pointer sliderConstraintNode::constraint()
{
// std::cout << "sliderConstraintNode::rigid_body" << std::endl;
MObject thisObject(thisMObject());
MObject update;
MPlug(thisObject, ca_constraint).getValue(update);
MPlug(thisObject, ca_constraintParam).getValue(update);
return m_constraint;
}
void sliderConstraintNode::update()
{
MObject thisObject(thisMObject());
MObject update;
MPlug(thisObject, ca_constraint).getValue(update);
MPlug(thisObject, ca_constraintParam).getValue(update);
MPlug(thisObject, worldMatrix).elementByLogicalIndex(0).getValue(update);
}

View File

@@ -1,110 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Herbert Law
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Herbert Law <Herbert.Law@gmail.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/
//sliderConstraintNode.h
#ifndef DYN_SLIDER_CONSTRAINT_NODE_H
#define DYN_SLIDER_CONSTRAINT_NODE_H
#include <maya/MString.h>
#include <maya/MTypeId.h>
#include <maya/MPxLocatorNode.h>
#include "solver.h"
class sliderConstraintNode: public MPxLocatorNode
{
public:
sliderConstraintNode();
virtual ~sliderConstraintNode();
virtual bool setInternalValueInContext ( const MPlug & plug,
const MDataHandle & dataHandle,
MDGContext & ctx);
// virtual MStatus setDependentsDirty ( const MPlug & plug, MPlugArray & plugArray);
virtual MStatus compute( const MPlug& plug, MDataBlock& data );
virtual void draw( M3dView & view, const MDagPath & path,
M3dView::DisplayStyle style,
M3dView::DisplayStatus status );
virtual bool isBounded() const ;
virtual MBoundingBox boundingBox() const;
virtual bool excludeAsLocator() const { return false; }
virtual bool isTransparent() const { return false; }
static void * creator();
static MStatus initialize();
public:
slider_constraint_t::pointer constraint();
void update();
public:
//Attributes
static MObject ia_rigidBodyA;
static MObject ia_rigidBodyB;
static MObject ia_damping;
static MObject ia_lowerLinLimit;
static MObject ia_upperLinLimit;
static MObject ia_lowerAngLimit;
static MObject ia_upperAngLimit;
static MObject ia_rotationInA;
static MObject ia_rotationInB;
static MObject ia_pivotInA;
static MObject ia_pivotInB;
static MObject ca_constraint;
static MObject ca_constraintParam;
public:
static MTypeId typeId;
static MString typeName;
private:
void computeConstraint(const MPlug& plug, MDataBlock& data);
void computeConstraintParam(const MPlug& plug, MDataBlock& data);
void computeWorldMatrix(const MPlug& plug, MDataBlock& data);
public:
static void nodeRemoved(MObject& node, void *clientData);
private:
slider_constraint_t::pointer m_constraint;
};
#endif //DYN_SLIDER_CONSTRAINT_NODE_H

View File

@@ -1,133 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Herbert Law
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Herbert Law <Herbert.Law@gmail.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/
//slider_constraint.h
#ifndef DYN_SLIDER_CONSTRAINT_H
#define DYN_SLIDER_CONSTRAINT_H
#include "shared_ptr.h"
#include "rigid_body.h"
#include "mathUtils.h"
#include "constraint.h"
#include "slider_constraint_impl.h"
class slider_constraint_t: public constraint_t
{
public:
//typedefs
typedef shared_ptr<slider_constraint_t> pointer;
//
rigid_body_t::pointer rigid_bodyA() { return m_rigid_bodyA; }
rigid_body_t::pointer rigid_bodyB() { return m_rigid_bodyB; }
//
void set_damping(float d) {
slider_constraint_impl_t* slider_impl = dynamic_cast<slider_constraint_impl_t*>(impl());
slider_impl->set_damping(d);
}
float damping() const {
slider_constraint_impl_t const* slider_impl = dynamic_cast<slider_constraint_impl_t const*>(impl());
return slider_impl->damping();
}
void set_LinLimit(float lower, float upper) {
slider_constraint_impl_t* slider_impl = dynamic_cast<slider_constraint_impl_t*>(impl());
slider_impl->set_LinLimit(lower, upper);
}
void set_AngLimit(float lower, float upper) {
slider_constraint_impl_t* slider_impl = dynamic_cast<slider_constraint_impl_t*>(impl());
slider_impl->set_AngLimit(lower, upper);
}
void get_frameA(vec3f& p, quatf& r) const {
slider_constraint_impl_t const* slider_impl = dynamic_cast<slider_constraint_impl_t const*>(impl());
slider_impl->get_frameA(p, r);
}
void get_frameB(vec3f& p, quatf& r) const {
slider_constraint_impl_t const* slider_impl = dynamic_cast<slider_constraint_impl_t const*>(impl());
slider_impl->get_frameB(p, r);
}
void get_invFrameA(vec3f& p, quatf& r) const {
slider_constraint_impl_t const* slider_impl = dynamic_cast<slider_constraint_impl_t const*>(impl());
slider_impl->get_invFrameA(p, r);
}
void get_invFrameB(vec3f& p, quatf& r) const {
slider_constraint_impl_t const* slider_impl = dynamic_cast<slider_constraint_impl_t const*>(impl());
slider_impl->get_invFrameB(p, r);
}
void worldToA(vec3f& w, vec3f& p) const {
slider_constraint_impl_t const* slider_impl = dynamic_cast<slider_constraint_impl_t const*>(impl());
slider_impl->worldToA(w, p);
}
void worldFromB(vec3f& p, vec3f& w) const {
slider_constraint_impl_t const* slider_impl = dynamic_cast<slider_constraint_impl_t const*>(impl());
slider_impl->worldFromB(p, w);
}
void set_world(vec3f const& p, quatf const& r)
{
slider_constraint_impl_t* slider_impl = dynamic_cast<slider_constraint_impl_t*>(impl());
slider_impl->set_world(p, r);
}
//local space pivot
void get_world(vec3f& p, quatf& r) const {
slider_constraint_impl_t const* slider_impl = dynamic_cast<slider_constraint_impl_t const*>(impl());
slider_impl->get_world(p, r);
}
public:
virtual ~slider_constraint_t() {};
protected:
friend class solver_t;
slider_constraint_t(slider_constraint_impl_t* impl, rigid_body_t::pointer& rigid_body):
constraint_t(impl),
m_rigid_bodyA(rigid_body)
{
}
slider_constraint_t(slider_constraint_impl_t* impl, rigid_body_t::pointer& rigid_bodyA, rigid_body_t::pointer& rigid_bodyB):
constraint_t(impl),
m_rigid_bodyA(rigid_bodyA),
m_rigid_bodyB(rigid_bodyB)
{
}
private:
rigid_body_t::pointer m_rigid_bodyA;
rigid_body_t::pointer m_rigid_bodyB;
};
#endif //DYN_SLIDER_CONSTRAINT_H

View File

@@ -1,56 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Herbert Law
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Herbert Law <Herbert.Law@gmail.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/
//slider_constraint_impl.h
#ifndef DYN_SLIDER_CONSTRAINT_IMPL_H
#define DYN_SLIDER_CONSTRAINT_IMPL_H
#include "constraint_impl.h"
class slider_constraint_impl_t: public constraint_impl_t
{
public:
//
virtual void set_world(vec3f const& p, quatf const& r) = 0;
virtual void get_world(vec3f& p, quatf& r) const = 0;
virtual void get_frameA(vec3f& p, quatf& r) const = 0;
virtual void get_frameB(vec3f& p, quatf& r) const = 0;
virtual void get_invFrameA(vec3f& p, quatf& r) const = 0;
virtual void get_invFrameB(vec3f& p, quatf& r) const = 0;
virtual void worldToA(vec3f& w, vec3f& p) const = 0;
virtual void worldFromB(vec3f& p, vec3f& w) const = 0;
//
virtual void set_damping(float d) = 0;
virtual float damping() const = 0;
virtual void set_LinLimit(float lower, float upper) = 0;
virtual void set_AngLimit(float lower, float upper) = 0;
public:
virtual ~slider_constraint_impl_t() {};
};
#endif //DYN_SLIDER_CONSTRAINT_IMPL_H

View File

@@ -1,44 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Walt Disney Studios
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Nicola Candussi <nicola@fluidinteractive.com>
*/
//convex_hull_shape.h
#ifndef DYN_CONVEX_HULL_SHAPE_H
#define DYN_CONVEX_HULL_SHAPE_H
#include "collision_shape.h"
#include "collision_shape_impl.h"
class convex_hull_shape_t: public collision_shape_t
{
public:
//typedefs
typedef shared_ptr<convex_hull_shape_t> pointer;
protected:
friend class solver_t;
convex_hull_shape_t(collision_shape_impl_t* impl): collision_shape_t(impl) { }
};
#endif

View File

@@ -1,39 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Walt Disney Studios
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Nicola Candussi <nicola@fluidinteractive.com>
*/
//convex_hull_shape_impl.h
#ifndef DYN_CONVEX_HULL_SHAPE_IMPL_H
#define DYN_CONVEX_HULL_SHAPE_IMPL_H
#include "collision_shape_impl.h"
class convex_hull_shape_impl_t: public collision_shape_impl_t
{
public:
//typedefs
private:
};
#endif

View File

@@ -1,147 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Walt Disney Studios
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Nicola Candussi <nicola@fluidinteractive.com>
*/
//dRigidBodyArrayCmd.cpp
#include <maya/MGlobal.h>
#include <maya/MItDependencyNodes.h>
#include <maya/MSyntax.h>
#include "rigidBodyArrayNode.h"
#include "dRigidBodyArrayCmd.h"
MString dRigidBodyArrayCmd::typeName("dRigidBodyArray");
dRigidBodyArrayCmd::dRigidBodyArrayCmd()
: m_argDatabase(0),
m_dagModifier(0)
{
}
dRigidBodyArrayCmd::~dRigidBodyArrayCmd()
{
if (m_argDatabase) {
delete m_argDatabase;
}
if (m_dagModifier) {
delete m_dagModifier;
}
}
void *
dRigidBodyArrayCmd::creator()
{
return new dRigidBodyArrayCmd;
}
MSyntax
dRigidBodyArrayCmd::syntax()
{
MSyntax syntax;
syntax.enableQuery(false);
syntax.enableEdit(false);
syntax.addFlag("-n", "-name", MSyntax::kString);
// syntax.addFlag("-fn", "-filename", MSyntax::kString);
// syntax.addFlag("-col", "-color", MSyntax::kString);
// syntax.addFlag("-dia", "-diameter", MSyntax::kDouble);
return syntax;
}
MStatus
dRigidBodyArrayCmd::doIt(const MArgList &args)
{
MStatus stat;
m_argDatabase = new MArgDatabase(syntax(), args, &stat);
if (stat == MS::kFailure) {
return stat;
}
return redoIt();
}
MStatus
dRigidBodyArrayCmd::undoIt()
{
MGlobal::setActiveSelectionList(m_undoSelectionList);
if (m_dagModifier) {
m_dagModifier->undoIt();
delete m_dagModifier;
m_dagModifier = 0;
}
return MS::kSuccess;
}
MStatus
dRigidBodyArrayCmd::redoIt()
{
MGlobal::getActiveSelectionList(m_undoSelectionList);
MString name;
if (m_argDatabase->isFlagSet("-name")) {
m_argDatabase->getFlagArgument("-name", 0, name);
}
if (!name.length()) {
name = "dRigidBodyArray";
}
m_dagModifier = new MDagModifier;
MObject parentObj = m_dagModifier->createNode("transform");
m_dagModifier->renameNode(parentObj, name + "#");
m_dagModifier->doIt();
MObject dRigidBodyArrayObj = m_dagModifier->createNode(rigidBodyArrayNode::typeId, parentObj);
std::string dRigidBodyArrayName = MFnDependencyNode(parentObj).name().asChar();
std::string::size_type pos = dRigidBodyArrayName.find_last_not_of("0123456789");
dRigidBodyArrayName.insert(pos + 1, "Shape");
m_dagModifier->renameNode(dRigidBodyArrayObj, dRigidBodyArrayName.c_str());
m_dagModifier->doIt();
// connect the solver attribute
MPlug plgSolver(dRigidBodyArrayObj, rigidBodyArrayNode::ia_solver);
MSelectionList slist;
slist.add("dSolver1");
MObject solverObj;
if(slist.length() != 0) {
slist.getDependNode(0, solverObj);
MPlug plgRigidBodies = MFnDependencyNode(solverObj).findPlug("rigidBodies", false);
m_dagModifier->connect(plgRigidBodies, plgSolver);
m_dagModifier->doIt();
}
MGlobal::select(parentObj, MGlobal::kReplaceList);
setResult(MFnDependencyNode(dRigidBodyArrayObj).name());
return MS::kSuccess;
}

View File

@@ -1,58 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Walt Disney Studios
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Nicola Candussi <nicola@fluidinteractive.com>
*/
//dRigidBodyArrayCmd.h
#ifndef DYN_DRIGIDBODYARRAYCMD_H
#define DYN_DRIGIDBODYARRAYCMD_H
#include <maya/MArgDatabase.h>
#include <maya/MDagModifier.h>
#include <maya/MSelectionList.h>
#include <maya/MPxCommand.h>
class dRigidBodyArrayCmd : public MPxCommand
{
public:
dRigidBodyArrayCmd();
virtual ~dRigidBodyArrayCmd();
static void *creator();
static MSyntax syntax();
MStatus doIt(const MArgList &i_mArgList);
MStatus redoIt();
MStatus undoIt();
bool isUndoable() const { return true; }
bool hasSyntax() const { return true; }
static MString typeName;
protected:
MArgDatabase *m_argDatabase;
MDagModifier *m_dagModifier;
MSelectionList m_undoSelectionList;
};
#endif

View File

@@ -1,147 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Walt Disney Studios
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Nicola Candussi <nicola@fluidinteractive.com>
*/
//dRigidBodyCmd.cpp
#include <maya/MGlobal.h>
#include <maya/MItDependencyNodes.h>
#include <maya/MSyntax.h>
#include "rigidBodyNode.h"
#include "dRigidBodyCmd.h"
MString dRigidBodyCmd::typeName("dRigidBody");
dRigidBodyCmd::dRigidBodyCmd()
: m_argDatabase(0),
m_dagModifier(0)
{
}
dRigidBodyCmd::~dRigidBodyCmd()
{
if (m_argDatabase) {
delete m_argDatabase;
}
if (m_dagModifier) {
delete m_dagModifier;
}
}
void *
dRigidBodyCmd::creator()
{
return new dRigidBodyCmd;
}
MSyntax
dRigidBodyCmd::syntax()
{
MSyntax syntax;
syntax.enableQuery(false);
syntax.enableEdit(false);
syntax.addFlag("-n", "-name", MSyntax::kString);
// syntax.addFlag("-fn", "-filename", MSyntax::kString);
// syntax.addFlag("-col", "-color", MSyntax::kString);
// syntax.addFlag("-dia", "-diameter", MSyntax::kDouble);
return syntax;
}
MStatus
dRigidBodyCmd::doIt(const MArgList &args)
{
MStatus stat;
m_argDatabase = new MArgDatabase(syntax(), args, &stat);
if (stat == MS::kFailure) {
return stat;
}
return redoIt();
}
MStatus
dRigidBodyCmd::undoIt()
{
MGlobal::setActiveSelectionList(m_undoSelectionList);
if (m_dagModifier) {
m_dagModifier->undoIt();
delete m_dagModifier;
m_dagModifier = 0;
}
return MS::kSuccess;
}
MStatus
dRigidBodyCmd::redoIt()
{
MGlobal::getActiveSelectionList(m_undoSelectionList);
MString name;
if (m_argDatabase->isFlagSet("-name")) {
m_argDatabase->getFlagArgument("-name", 0, name);
}
if (!name.length()) {
name = "dRigidBody";
}
m_dagModifier = new MDagModifier;
MObject parentObj = m_dagModifier->createNode("transform");
m_dagModifier->renameNode(parentObj, name + "#");
m_dagModifier->doIt();
MObject dRigidBodyObj = m_dagModifier->createNode(rigidBodyNode::typeId, parentObj);
std::string dRigidBodyName = MFnDependencyNode(parentObj).name().asChar();
std::string::size_type pos = dRigidBodyName.find_last_not_of("0123456789");
dRigidBodyName.insert(pos + 1, "Shape");
m_dagModifier->renameNode(dRigidBodyObj, dRigidBodyName.c_str());
m_dagModifier->doIt();
// connect the solver attribute
MPlug plgSolver(dRigidBodyObj, rigidBodyNode::ia_solver);
MSelectionList slist;
slist.add("dSolver1");
MObject solverObj;
if(slist.length() != 0) {
slist.getDependNode(0, solverObj);
MPlug plgRigidBodies = MFnDependencyNode(solverObj).findPlug("rigidBodies", false);
m_dagModifier->connect(plgRigidBodies, plgSolver);
m_dagModifier->doIt();
}
// MGlobal::select(parentObj, MGlobal::kReplaceList);
setResult(MFnDependencyNode(dRigidBodyObj).name());
return MS::kSuccess;
}

View File

@@ -1,58 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Walt Disney Studios
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Nicola Candussi <nicola@fluidinteractive.com>
*/
//dRigidBodyCmd.h
#ifndef DYN_DRIGIDBODYCMD_H
#define DYN_DRIGIDBODYCMD_H
#include <maya/MArgDatabase.h>
#include <maya/MDagModifier.h>
#include <maya/MSelectionList.h>
#include <maya/MPxCommand.h>
class dRigidBodyCmd : public MPxCommand
{
public:
dRigidBodyCmd();
virtual ~dRigidBodyCmd();
static void *creator();
static MSyntax syntax();
MStatus doIt(const MArgList &i_mArgList);
MStatus redoIt();
MStatus undoIt();
bool isUndoable() const { return true; }
bool hasSyntax() const { return true; }
static MString typeName;
protected:
MArgDatabase *m_argDatabase;
MDagModifier *m_dagModifier;
MSelectionList m_undoSelectionList;
};
#endif

View File

@@ -1,141 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Walt Disney Studios
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Nicola Candussi <nicola@fluidinteractive.com>
*/
//dSolverCmd.cpp
#include <maya/MItDependencyNodes.h>
#include <maya/MSyntax.h>
#include "dSolverNode.h"
#include "dSolverCmd.h"
MString dSolverCmd::typeName("dSolver");
dSolverCmd::dSolverCmd()
: m_argDatabase(0),
m_dgModifier(0)
{
}
dSolverCmd::~dSolverCmd()
{
if (m_argDatabase) {
delete m_argDatabase;
}
if (m_dgModifier) {
delete m_dgModifier;
}
}
void *
dSolverCmd::creator()
{
return new dSolverCmd;
}
MSyntax
dSolverCmd::syntax()
{
MSyntax syntax;
syntax.enableQuery(false);
syntax.enableEdit(false);
return syntax;
}
MStatus
dSolverCmd::doIt(const MArgList &args)
{
MStatus stat;
m_argDatabase = new MArgDatabase(syntax(), args, &stat);
if (stat == MS::kFailure) {
return stat;
}
return redoIt();
}
MStatus
dSolverCmd::undoIt()
{
if (m_dgModifier) {
m_dgModifier->undoIt();
delete m_dgModifier;
m_dgModifier = 0;
}
return MS::kSuccess;
}
MStatus
dSolverCmd::redoIt()
{
MStatus stat;
// see if node exists
MItDependencyNodes depIt(MFn::kPluginDependNode);
for (; !depIt.isDone(); depIt.next()) {
MObject obj = depIt.thisNode();
if (MFnDependencyNode(obj).typeId() == dSolverNode::typeId) {
return stat;
}
}
m_dgModifier = new MDagModifier;
MObject parentObj = m_dgModifier->createNode("transform");
m_dgModifier->renameNode(parentObj, "dDebugDraw");
m_dgModifier->doIt();
MObject dSolverObj = m_dgModifier->createNode(dSolverNode::typeId, parentObj, &stat);
if(stat != MStatus::kSuccess)
{
MString errStr = stat.errorString();
fprintf(stderr, "ERROR : %s\n", errStr.asChar());
}
m_dgModifier->doIt();
// connect the time attribute
MPlug plgInTime(dSolverObj, dSolverNode::ia_time);
MItDependencyNodes depNodeIt(MFn::kTime);
MObject timeObj = depNodeIt.thisNode();
if (timeObj != MObject::kNullObj) {
MPlug plgOutTime = MFnDependencyNode(timeObj).findPlug("outTime", false);
m_dgModifier->connect(plgOutTime, plgInTime);
m_dgModifier->doIt();
}
//force update of the solver on creation
MPlug plgRigidBodies(dSolverObj, dSolverNode::oa_rigidBodies);
bool update;
plgRigidBodies.getValue(update);
setResult(MFnDependencyNode(dSolverObj).name());
return stat;
}

View File

@@ -1,57 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Walt Disney Studios
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Nicola Candussi <nicola@fluidinteractive.com>
*/
//dSolverCmd.h
#ifndef DYN_DSOLVERCMD_H
#define DYN_DSOLVERCMD_H
#include <maya/MArgDatabase.h>
#include <maya/MDagModifier.h>
#include <maya/MPxCommand.h>
class dSolverCmd : public MPxCommand
{
public:
dSolverCmd();
virtual ~dSolverCmd();
static void *creator();
static MSyntax syntax();
MStatus doIt(const MArgList &i_mArgList);
MStatus redoIt();
MStatus undoIt();
bool isUndoable() const { return true; }
bool hasSyntax() const { return true; }
static MString typeName;
protected:
MArgDatabase *m_argDatabase;
MDagModifier *m_dgModifier;
// MDGModifier *m_dgModifier;
};
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -1,138 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Walt Disney Studios
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Nicola Candussi <nicola@fluidinteractive.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/
//dSolverNode.h
#ifndef DYN_DSOLVERNODE_H
#define DYN_DSOLVERNODE_H
#include <maya/MString.h>
#include <maya/MTypeId.h>
#include <maya/MPxNode.h>
#include <maya/MPxLocatorNode.h>
#include <maya/MTime.h>
#include <vector>
#include "mathUtils.h"
//class dSolverNode : public MPxNode
class dSolverNode : public MPxLocatorNode
{
public:
dSolverNode();
virtual ~dSolverNode();
virtual void postConstructor();
virtual void draw( M3dView & view, const MDagPath & path,
M3dView::DisplayStyle style,
M3dView::DisplayStatus status );
virtual bool isBounded() const {
return false;
}
virtual MBoundingBox boundingBox() const
{
MObject node = thisMObject();
MPoint corner1(-1, -1, -1);
MPoint corner2(1, 1, 1);
return MBoundingBox(corner1, corner2);
}
virtual bool excludeAsLocator() const {
return false;
}
virtual bool isTransparent() const {
return false;
}
static void * creator();
static MStatus initialize();
virtual bool setInternalValueInContext ( const MPlug & plug, const MDataHandle & dataHandle, MDGContext & ctx );
virtual MStatus compute( const MPlug& plug, MDataBlock& data );
static MObject ia_time;
static MObject ia_startTime;
static MObject ia_gravity;
static MObject ia_enabled;
static MObject ia_splitImpulse;
static MObject ia_substeps;
static MObject oa_rigidBodies;
//Solver Settings
static MObject ssSolverType;
//
static MObject ia_DBG_DrawWireframe;
static MObject ia_DBG_DrawAabb;
static MObject ia_DBG_DrawFeaturesText;
static MObject ia_DBG_DrawContactPoints;
static MObject ia_DBG_NoDeactivation;
static MObject ia_DBG_NoHelpText;
static MObject ia_DBG_DrawText;
static MObject ia_DBG_ProfileTimings;
static MObject ia_DBG_EnableSatComparison;
static MObject ia_DBG_DisableBulletLCP;
static MObject ia_DBG_EnableCCD;
static MObject ia_DBG_DrawConstraints;
static MObject ia_DBG_DrawConstraintLimits;
static MObject ia_DBG_FastWireframe;
//
public:
static MTypeId typeId;
static MString typeName;
static bool isStartTime;
static void updateAllRigidBodies();
protected:
struct xforms_t {
vec3f m_x0;
vec3f m_x1;
quatf m_q0;
quatf m_q1;
};
void computeRigidBodies(const MPlug& plug, MDataBlock& data);
void dumpRigidBodyArray(MObject &node);
bool expandFileExpression(std::string const& expr, std::string &base_name, std::string &extension);
void initRigidBodies(MPlugArray &rbConnections);
void gatherPassiveTransforms(MPlugArray &rbConnections, std::vector<xforms_t> &xforms);
void updatePassiveRigidBodies(MPlugArray &rbConnections, std::vector<xforms_t> &xforms, float t);
void updateActiveRigidBodies(MPlugArray &rbConnections);
void applyFields(MPlugArray &rbConnections, float dt);
void updateConstraint(MObject& bodyNode);
protected:
MTime m_prevTime;
};
#endif

View File

@@ -1,123 +0,0 @@
<html>
<!-- Dynamica documentation v. 0.0.1 -->
<head>
<title>Introduction to Dynamica, the Dynamics plugin for Maya</title>
</head>
<body>
<h1> Introduction to Dynamica </h1>
<p>
<h3>Rationale</h3>
Dynamica allows to perform rigid body simulations inside Maya, using different underlying libraries. Right now
only Bullet Physics is supported, but in the future other library will be added, such as NVidia PhysX. It will be possible
to switch between libraries on the fly. This will be useful for example when some parts of the simulation are particularly
critical, requiring the need for a more precise (but slower library). It will still be possible to use a less precise (but faster)
library in the non-critical part of the simulation.
</p>
<p>
<h3>Basics</h3>
The functionality is provided by four types of custom Maya nodes that interact with each other: <b>dSolver</b>, <b>dRigidBody</b>,
<b>dRigidBodyArray</b>, <b>dCollisionShape</b>. The different nodes can be created thru the Dynamica UI. This UI can be accessed
by clicking on the Dynamica icon in the EfxToolsLumiere shelf.
<h5>dSolver</h5>
There is only one of this nodes per scene. It controls the global parameters of the simulation, such as time step, library used for
the simulation, ecc. It is created automatically every time a Rigid Body or a Rigid Body array is created.
<h5>dRigidBody</h5>
There can be multiple rigid bodies in the scene. It has different attributes that control it's behavior, such as mass, damping,
initial position/velocity, ecc.
It can be active or passive. An active rigid body is controlled by the forces and collisions in the simulation. A passive rigid
body (sometimes called Kinematic) is just keyframed.
</p>
<h5>dCollisionShape</h5>
Represents the shape that is used to compute the collisions between rigid bodies. Every rigid body connects to a collision shape.
Best practice is to use a collision shape that is good enough to represent the desired collision behavior. The simpler the collision
shape, the faster the simulation.
Currently the collision shape available are: sphere, box, infinite plane, convex hull, mesh. The convex hull collision shape and the
mesh connect directly to a Maya mesh. The mesh collision shape is more precise for concave meshes, otherwise the convex hull shape should
be used, because it's faster.
</body>
<h5>dRigidBodyArray</h5>
It's like a rigid body but can contain multiple rigid bodies sharing the same collision shape and simulation parameters. It's
the node of choice when the rigid bodies have the same shape and speed is required. The attributes that control the initial configuration are:
<b>NumRigidBodies</b>, <b>InitialPosition (Multi)</b>, <b>InitialRotation (Multi)</b>, <b>InitialVelocity (Multi)</b>,
<b>InitialSpin (Multi)</b>
<h3>Quick Start</h3>
The following are simple examples that show the basic functionalities of Dynamica. All the command can be accessed thru the Dynamica
UI from the EfxToolsLumiere shelf.
<h5>Simple rolling sphere</h5>
In the dynamica UI, click on "Create passive plane". It creates an infinite plane centered in (0,0,0). With the rotation manipulator,
tilt the plane a little bit. <br>
Deselect the plane. (<b>Important:</b> when creating a rigid body, if something is selected, the newly created rigid body has it's
initial position and rotation set to the one of the selected object).
Click on "Create active sphere". It creates an active rigid body with a sphere as collision shape, centered in (0,0,0). With
the move manipulator, move it up to (0,10,0). <br>
Now roll back the time slider to the first frame and hit play (Remember to extend the animation range as necessary). <br>
In general, it's good to roll back the animation to the first frame every time new objects are created, to allow everything to synch up.
By taking a look at the hypergraph for the rigid body, it's possible to have a better idea on how things are organized.
<h5>Arbitrary Mesh</h5>
Create a polygonal mesh in Maya, for example, an helix. With the helix still selected, click on "Create active Mesh". A new rigid body is created,
with the helix as input to the Mesh collision shape. Alternatively, "Create active Convex Hull" could be used. The convex hull provides
faster simulations at the expense of less precise collisions (if the input mesh is convex, the is no difference between Convex Hull and Mesh
collision shapes in term of precision).
Then repeat the same step of the Simple rolling sphere example.
<h5>Rigid Body Array</h5>
Create a maya polygonal mesh in Maya, for example a torus. Resize the torus so that the size of the bounding box is around 1x1x1.
With the torus still selected, hit "Create Active Rigid Body Array" in the UI. As small dialog box appears, asking for the dimensions
of the array and the offset between the rigid bodies. Enter (10, 20, 10) for the dimensions and (2.5, 2.5, 2.5) as offset. <br>
Create a passive plane as before, then translate the rigid body array so that all donuts are above the plane. <br>
Roll back the simulation, then hit play. <br>
The initial configuration of the rigid body array can be changed by modifying the proper attributes, for example with a mel script.
The following is an example mel script that changes the initial configuration of a rigid body array: <br>
<pre>
proc setConfiguration()
{
//the name of the rigid body array node
string $rigidBodyArray = "myRigidBodyArray";
//set the number of bodies
setAttr ($rigidBodyArray + ".numBodies") (10 * 10 * 10);
for($i = 0; $i < 10; $i++) {
for($j = 0; $j < 10; $j++) {
for($k = 0; $k < 10; $k++) {
//set the initial position
setAttr ($children[0] + ".initialPosition[" + string($i + 10 * $j + 100 * $k) + "]") ($i * 2) (10 + $k * 2) ($j * 2);
//set the initial rotation to (0, 0, 0)
setAttr ($children[0] + ".initialRotation[" + string($i + 10 * $j + 100 * $k) + "]") 0 0 0;
}
}
}
}
</pre>
<h5>Kinematic objects</h5>
Kinematic objects are handled by setting the keyframing the parent transform of a passive rigid body. If the keyframed animation is really fast,
it's possible that some object would leak thru the kinematic object. To reduce the problem, try increasing the number of substeps in the Solver
tab of the Dynamica UI or in the dSolver1 node. Note how the substeps attribute is keyable. This way, it's possible to set a different number of
substeps all along the simulation, depending on how complicated it is at each time step, trading speed for accuracy.
<h5>Sample scenes</h5>
In the subdirectory scenes/ there are some sample setups.
<h5>Online instruction movies for usage of the Maya Plugin</h5>
You can download (right-click - save) or watch those instruction movies on-line.
</br><a href="http://www.bulletphysics.com/ftp/pub/test/index.php?dir=physics/movies/&file=bullet_intro.mp4">Maya Plugin Intro (28Mb)</a>
</br><a href="http://www.bulletphysics.com/ftp/pub/test/index.php?dir=physics/movies/&file=bullet_fields.mp4">Using Maya Force Fields (17Mb)</a>
</br><a href="http://www.bulletphysics.com/ftp/pub/test/index.php?dir=physics/movies/&file=bullet_donut.mp4">Creating Donuts (11Mb)</a>
</br><a href="http://www.bulletphysics.com/ftp/pub/test/index.php?dir=physics/movies/&file=bullet_peanuts.mp4">Creating Peanuts, used in upcoming Bolt Movie (29Mb)</a>
</br><a href="http://www.bulletphysics.com/ftp/pub/test/index.php?dir=physics/movies/&file=BoltPeanutsShot.mov">Part of Bolt trailer with Peanuts shot (26Mb)</a>
<h5>Online support forums</h5>
Visit the Bullet forums for support and feedback: <a href="http://bulletphysics.com">http://bulletphysics.com</a>
</html>

View File

@@ -1,171 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Walt Disney Studios
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Nicola Candussi <nicola@fluidinteractive.com>
*/
#include <iostream>
#ifdef WIN32//for glut.h
#include <windows.h>
#endif
//think different
#if defined(__APPLE__) && !defined (VMDMESA)
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#include <GLUT/glut.h>
#else
#include <GL/gl.h>
#include <GL/glu.h>
#endif
void wire_cube()
{
static GLuint dlist = 0;
if(glIsList(dlist)) {
glCallList(dlist);
} else {
dlist = glGenLists(1);
glNewList(dlist, GL_COMPILE_AND_EXECUTE);
glBegin(GL_LINE_STRIP);
glVertex3f(-0.5f, -0.5, 0.5);
glVertex3f(0.5f, -0.5, 0.5);
glVertex3f(0.5f, 0.5, 0.5);
glVertex3f(-0.5f, 0.5, 0.5);
glVertex3f(-0.5f, -0.5, 0.5);
glEnd();
glBegin(GL_LINE_STRIP);
glVertex3f(-0.5f, -0.5, -0.5);
glVertex3f(0.5f, -0.5, -0.5);
glVertex3f(0.5f, 0.5, -0.5);
glVertex3f(-0.5f, 0.5, -0.5);
glVertex3f(-0.5f, -0.5, -0.5);
glEnd();
glBegin(GL_LINES);
glVertex3f(-0.5f, -0.5f, 0.5f);
glVertex3f(-0.5f, -0.5f, -0.5f);
glVertex3f(0.5f, -0.5f, 0.5f);
glVertex3f(0.5f, -0.5f, -0.5f);
glVertex3f(0.5f, 0.5f, 0.5f);
glVertex3f(0.5f, 0.5f, -0.5f);
glVertex3f(-0.5f, 0.5f, 0.5f);
glVertex3f(-0.5f, 0.5f, -0.5f);
glEnd();
glEndList();
}
}
void solid_cube()
{
static GLuint dlist = 0;
if(glIsList(dlist)) {
glCallList(dlist);
} else {
dlist = glGenLists(1);
glNewList(dlist, GL_COMPILE_AND_EXECUTE);
glBegin(GL_QUADS);
glNormal3f(-1.0f, 0.0f, 0.0f);
glVertex3f(-0.5f, -0.5f, -0.5f);
glVertex3f(-0.5f, -0.5f, 0.5f);
glVertex3f(-0.5f, 0.5f, 0.5f);
glVertex3f(-0.5f, 0.5f, -0.5f);
glNormal3f(0.0f, 1.0f, 0.0f);
glVertex3f(-0.5f, 0.5f, -0.5f);
glVertex3f(-0.5f, 0.5f, 0.5f);
glVertex3f(0.5f, 0.5f, 0.5f);
glVertex3f(0.5f, 0.5f, -0.5f);
glNormal3f(1.0f, 0.0f, 0.0f);
glVertex3f(0.5f, 0.5f, -0.5f);
glVertex3f(0.5f, 0.5f, 0.5f);
glVertex3f(0.5f, -0.5f, 0.5f);
glVertex3f(0.5f, -0.5f, -0.5f);
glNormal3f(0.0f, -1.0f, 0.0f);
glVertex3f(0.5f, -0.5f, -0.5f);
glVertex3f(0.5f, -0.5f, 0.5f);
glVertex3f(-0.5f, -0.5f, 0.5f);
glVertex3f(-0.5f, -0.5f, -0.5f);
glNormal3f(1.0f, 0.0f, 0.0f);
glVertex3f(0.5f, 0.5f, -0.5f);
glVertex3f(0.5f, 0.5f, 0.5f);
glVertex3f(0.5f, -0.5f, 0.5f);
glVertex3f(0.5f, -0.5f, -0.5f);
glNormal3f(0.0f, 0.0f, 1.0f);
glVertex3f(-0.5f, -0.5f, 0.5f);
glVertex3f(0.5f, -0.5f, 0.5f);
glVertex3f(0.5f, 0.5f, 0.5f);
glVertex3f(-0.5f, 0.5f, 0.5f);
glNormal3f(0.0f, 0.0f, -1.0f);
glVertex3f(0.5f, -0.5f, -0.5f);
glVertex3f(-0.5f, -0.5f, -0.5f);
glVertex3f(-0.5f, 0.5f, -0.5f);
glVertex3f(0.5f, 0.5f, -0.5f);
glEnd();
glEndList();
}
}
void wire_sphere()
{
static GLuint dlist = 0;
if(glIsList(dlist)) {
glCallList(dlist);
} else {
GLUquadricObj* quadric = gluNewQuadric();
gluQuadricDrawStyle(quadric, GLU_LINE);
dlist = glGenLists(1);
glNewList(dlist, GL_COMPILE_AND_EXECUTE);
gluSphere(quadric, 1.0, 10, 10);
glEndList();
gluDeleteQuadric(quadric);
}
}
void solid_sphere()
{
static GLuint dlist = 0;
if(glIsList(dlist)) {
glCallList(dlist);
} else {
GLUquadricObj* quadric = gluNewQuadric();
gluQuadricDrawStyle(quadric, GLU_FILL);
dlist = glGenLists(1);
glNewList(dlist, GL_COMPILE_AND_EXECUTE);
gluSphere(quadric, 1.0, 10, 10);
glEndList();
gluDeleteQuadric(quadric);
}
}

View File

@@ -1,33 +0,0 @@
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Walt Disney Studios
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Nicola Candussi <nicola@fluidinteractive.com>
*/
//drawUtils.h
#ifndef DYN_DRAW_UTILS_H
#define DYN_DRAW_UTILS_H
void wire_cube();
void solid_cube();
void wire_sphere();
void solid_sphere();
#endif

View File

@@ -1,511 +0,0 @@
/* XPM */
static char * dynamica1_xpm[] = {
"32 32 476 2",
" c #B1B1B1",
". c #B0B0B0",
"+ c #AFAFAF",
"@ c #AAAAAA",
"# c #A8A8A8",
"$ c #ABABAB",
"% c #A6A6A6",
"& c #A9A9A9",
"* c #AAA9A7",
"= c #979288",
"- c #9B9B9B",
"; c #959595",
"> c #9F9F9F",
", c #625236",
"' c #402900",
") c #776C57",
"! c #ADADAD",
"~ c #A0A0A0",
"{ c #9A9A9A",
"] c #776C58",
"^ c #6A5C44",
"/ c #919190",
"( c #898989",
"_ c #908E8B",
": c #47320C",
"< c #5D4D2F",
"[ c #A5A5A5",
"} c #99948B",
"| c #B1B0B0",
"1 c #9E9E9E",
"2 c #8D8D8D",
"3 c #8C8C8C",
"4 c #756B5B",
"5 c #62563F",
"6 c #82817E",
"7 c #736B5C",
"8 c #49340F",
"9 c #908F8E",
"0 c #989898",
"a c #817969",
"b c #442E06",
"c c #48320C",
"d c #ABAAA7",
"e c #AEAEAE",
"f c #868686",
"g c #777267",
"h c #402901",
"i c #47330E",
"j c #432D05",
"k c #524122",
"l c #5B4B2F",
"m c #584626",
"n c #B0AFAF",
"o c #A7A7A7",
"p c #9B9893",
"q c #8E8A83",
"r c #7E7A74",
"s c #412A02",
"t c #72654E",
"u c #929292",
"v c #91908E",
"w c #503D1C",
"x c #422B03",
"y c #514020",
"z c #665A44",
"A c #564526",
"B c #48330D",
"C c #675940",
"D c #80786A",
"E c #918E88",
"F c #969595",
"G c #84817B",
"H c #70685A",
"I c #5D4F36",
"J c #47320D",
"K c #7D7463",
"L c #999999",
"M c #8A8A8A",
"N c #848382",
"O c #534224",
"P c #5D4C2D",
"Q c #8D8579",
"R c #939393",
"S c #776F63",
"T c #574627",
"U c #4C3815",
"V c #675942",
"W c #635438",
"X c #594727",
"Y c #625235",
"Z c #A2A2A2",
"` c #878787",
" . c #817E79",
".. c #47310C",
"+. c #5D4C2E",
"@. c #99948C",
"#. c #909090",
"$. c #79746B",
"%. c #402A01",
"&. c #9E9B94",
"*. c #8F8F8F",
"=. c #827B6F",
"-. c #412A01",
";. c #49340E",
">. c #8E877A",
",. c #9C9C9C",
"'. c #8E8E8E",
"). c #767067",
"!. c #503E1E",
"~. c #4E3A16",
"{. c #969086",
"]. c #A4A4A4",
"^. c #979797",
"/. c #949492",
"(. c #776D5A",
"_. c #6C5E45",
":. c #9D9D9D",
"<. c #949494",
"[. c #767065",
"}. c #514022",
"|. c #3F2900",
"1. c #46300A",
"2. c #9F9B95",
"3. c #ACACAC",
"4. c #A1A1A1",
"5. c #6E6556",
"6. c #5D4E35",
"7. c #4E3A17",
"8. c #8A8274",
"9. c #919191",
"0. c #8B8B8B",
"a. c #6F685B",
"b. c #4D3C1C",
"c. c #3E2800",
"d. c #432E08",
"e. c #63563F",
"f. c #7A7160",
"g. c #53401E",
"h. c #45300A",
"i. c #A09C97",
"j. c #A3A3A3",
"k. c #878786",
"l. c #6B6354",
"m. c #493615",
"n. c #3C2700",
"o. c #472600",
"p. c #672A07",
"q. c #923918",
"r. c #B23610",
"s. c #CC3102",
"t. c #D54012",
"u. c #B04012",
"v. c #8C4118",
"w. c #7A583B",
"x. c #867D6E",
"y. c #A6A4A0",
"z. c #6F675B",
"A. c #564629",
"B. c #432C06",
"C. c #3F2800",
"D. c #9E9E9D",
"E. c #838280",
"F. c #675D4D",
"G. c #44300F",
"H. c #3B2600",
"I. c #3A2500",
"J. c #54280B",
"K. c #762B12",
"L. c #882000",
"M. c #A02600",
"N. c #B82B00",
"O. c #CF3100",
"P. c #E13B07",
"Q. c #E44E1F",
"R. c #E76036",
"S. c #C9623C",
"T. c #864B24",
"U. c #4D3915",
"V. c #8A8780",
"W. c #4E3C1C",
"X. c #7F7D77",
"Y. c #7E7D7B",
"Z. c #615644",
"`. c #3F2D0A",
" + c #392500",
".+ c #493819",
"++ c #674231",
"@+ c #5E1701",
"#+ c #701B00",
"$+ c #A32600",
"%+ c #BC2C00",
"&+ c #D43200",
"*+ c #E13E0B",
"=+ c #E45224",
"-+ c #E7653D",
";+ c #EA7652",
">+ c #EB8363",
",+ c #9B6241",
"'+ c #7F7F7F",
")+ c #838383",
"!+ c #4D3E22",
"~+ c #392400",
"{+ c #4D3F26",
"]+ c #3C2906",
"^+ c #382300",
"/+ c #372300",
"(+ c #4A3A1D",
"_+ c #787268",
":+ c #79615A",
"<+ c #4F1301",
"[+ c #5B1600",
"}+ c #731B00",
"|+ c #8D2100",
"1+ c #AA2800",
"2+ c #C32E00",
"3+ c #D93300",
"4+ c #E2410F",
"5+ c #E55427",
"6+ c #E86840",
"7+ c #EB7B58",
"8+ c #ED8B6D",
"9+ c #EE977C",
"0+ c #CBA89E",
"a+ c #969696",
"b+ c #888888",
"c+ c #797979",
"d+ c #737373",
"e+ c #5B5446",
"f+ c #372603",
"g+ c #352200",
"h+ c #342100",
"i+ c #4A3C23",
"j+ c #78746C",
"k+ c #877F7C",
"l+ c #542A1D",
"m+ c #4C1200",
"n+ c #5F1600",
"o+ c #7A1D00",
"p+ c #982400",
"q+ c #B32A00",
"r+ c #CA3000",
"s+ c #DD3400",
"t+ c #E24210",
"u+ c #E55326",
"v+ c #E8663E",
"w+ c #EE8E70",
"x+ c #F09D83",
"y+ c #E5A794",
"z+ c #BBAFAB",
"A+ c #848484",
"B+ c #6A6A69",
"C+ c #9D8100",
"D+ c #DCB600",
"E+ c #F7CC00",
"F+ c #F3C900",
"G+ c #EDC400",
"H+ c #E6BE00",
"I+ c #E0B900",
"J+ c #DBB500",
"K+ c #D8B300",
"L+ c #936800",
"M+ c #421000",
"N+ c #4E1200",
"O+ c #651800",
"P+ c #831F00",
"Q+ c #BD2D00",
"R+ c #D13100",
"S+ c #DF3500",
"T+ c #E45022",
"U+ c #E7633A",
"V+ c #EA7855",
"W+ c #F09F86",
"X+ c #F2AA94",
"Y+ c #CEAFA5",
"Z+ c #7B7B7B",
"`+ c #6B6B6B",
" @ c #666564",
".@ c #746000",
"+@ c #D1AC00",
"@@ c #F9CE03",
"#@ c #F4CA03",
"$@ c #EDC403",
"%@ c #E6BE03",
"&@ c #E0B903",
"*@ c #DBB503",
"=@ c #D8B303",
"-@ c #6D4101",
";@ c #431000",
">@ c #521300",
",@ c #6B1900",
"'@ c #8C2100",
")@ c #AB2900",
"!@ c #C52F00",
"~@ c #D53300",
"{@ c #E03500",
"]@ c #E13F0C",
"^@ c #E34B1C",
"/@ c #E65D33",
"(@ c #EA744F",
"_@ c #F0A087",
":@ c #F2AD97",
"<@ c #DFB1A3",
"[@ c #7D7D7D",
"}@ c #727272",
"|@ c #6E6E6E",
"1@ c #655300",
"2@ c #C9A500",
"3@ c #F8CC00",
"4@ c #F2C700",
"5@ c #EBC200",
"6@ c #E4BC00",
"7@ c #DEB700",
"8@ c #DAB400",
"9@ c #D7B100",
"0@ c #502300",
"a@ c #441000",
"b@ c #541400",
"c@ c #922300",
"d@ c #B12A00",
"e@ c #C93000",
"f@ c #D83300",
"g@ c #E13C09",
"h@ c #E34717",
"i@ c #E6592E",
"j@ c #E9704A",
"k@ c #ED896A",
"l@ c #F09E85",
"m@ c #EBB2A0",
"n@ c #818181",
"o@ c #787878",
"p@ c #C8A400",
"q@ c #F7CB00",
"r@ c #F1C600",
"s@ c #E9C000",
"t@ c #E2BA00",
"u@ c #DDB600",
"v@ c #D9B300",
"w@ c #3F1000",
"x@ c #551400",
"y@ c #711B00",
"z@ c #932300",
"A@ c #B22A00",
"B@ c #E34615",
"C@ c #E5562A",
"D@ c #E96D47",
"E@ c #ED8767",
"F@ c #F09C82",
"G@ c #F2AC96",
"H@ c #F2B19D",
"I@ c #808080",
"J@ c #747474",
"K@ c #F6CB00",
"L@ c #DCB500",
"M@ c #D6B000",
"N@ c #502200",
"O@ c #531400",
"P@ c #6E1A00",
"Q@ c #8F2200",
"R@ c #AF2900",
"S@ c #C72F00",
"T@ c #D63300",
"U@ c #E96C46",
"V@ c #EC8464",
"W@ c #EF9A7F",
"X@ c #F2A992",
"Y@ c #EBAF9D",
"Z@ c #6C4100",
"`@ c #410F00",
" # c #4F1300",
".# c #671800",
"+# c #862000",
"@# c #A52700",
"## c #BF2D00",
"$# c #DC3400",
"%# c #E34616",
"&# c #E5572B",
"*# c #EC8363",
"=# c #EF977C",
"-# c #F1A48C",
";# c #DEAB9C",
"># c #926800",
",# c #3F0F00",
"'# c #4A1100",
")# c #5E1600",
"!# c #D73300",
"~# c #E03804",
"{# c #E5582C",
"]# c #EC8160",
"^# c #EE9276",
"/# c #F09E84",
"(# c #CEAA9F",
"_# c #F9CD00",
":# c #F4C900",
"<# c #EDC300",
"[# c #E6BD00",
"}# c #E0B800",
"|# c #DBB400",
"1# c #D8B200",
"2# c #C09800",
"3# c #5C2F08",
"4# c #451000",
"5# c #6C1A00",
"6# c #A32700",
"7# c #BB2C00",
"8# c #CE3100",
"9# c #E24413",
"0# c #E86942",
"a# c #EB7C59",
"b# c #E39A84",
"c# c #BBADA9",
"d# c #828282",
"e# c #767676",
"f# c #C9A600",
"g# c #FACE00",
"h# c #F0C600",
"i# c #E3BB00",
"j# c #9B7318",
"k# c #451101",
"l# c #4D1200",
"m# c #601700",
"n# c #781C00",
"o# c #AC2900",
"p# c #C22E00",
"q# c #E45123",
"r# c #E7643B",
"s# c #EA7450",
"t# c #EC8262",
"u# c #C9A194",
"v# c #CAA600",
"w# c #FCD000",
"x# c #F3C800",
"y# c #E8BF00",
"z# c #DABA29",
"A# c #916D34",
"B# c #4D1301",
"C# c #591500",
"D# c #9E2500",
"E# c #B62B00",
"F# c #CD3000",
"G# c #E03702",
"H# c #E34A1A",
"I# c #E65C31",
"J# c #E86D46",
"K# c #CC9482",
"L# c #6E5B00",
"M# c #F6CA00",
"N# c #DAB300",
"O# c #DEBD20",
"P# c #DDC65E",
"Q# c #7C635B",
"R# c #662E1D",
"S# c #691900",
"T# c #7E1E00",
"U# c #952300",
"V# c #AD2900",
"W# c #DA3400",
"X# c #DA6440",
"Y# c #C6907F",
"Z# c #8A7200",
"`# c #C4A100",
" $ c #DFB700",
".$ c #DCB400",
"+$ c #D5AF00",
"@$ c #D0AB00",
"#$ c #CDA800",
"$$ c #E4BC01",
"%$ c #E2C53B",
"&$ c #948884",
"*$ c #896357",
"=$ c #8A4632",
"-$ c #963214",
";$ c #A92902",
">$ c #BC3C14",
",$ c #C75735",
"'$ c #C57B64",
")$ c #B79F98",
" ",
" . . . + @ # $ . ",
" . @ % & * = @ - ; > , ' ) + + . ",
" ! ~ ; { ] ' ^ / ( _ : ' < [ [ ! } = | ",
" ! 1 2 3 4 ' ' 5 6 7 ' ' 8 9 0 a b c d ",
" . . . . e ~ 2 f g h ' ' i j ' ' h k l ' ' m n ",
" e o [ o p q 3 f r s ' ' ' ' ' ' ' ' ' ' ' t ",
" . & { u v w x y z A ' B C D E F G H I J ' ' K $ + ",
" . & L M N O ' ' ' ' P Q . + ! # > R 3 S T ' U V W X Y * ",
" e Z u ` ...' ' +.@. . $ ~ #.( $.O ' ' ' ' %.&. ",
" . $ - 3 *.=.-.;.>. . + ! % ,.'.f ).!.' ' ' ~.{. ",
". ! @ ].^.'./.(.%._. . . + $ [ :.<.2 [.}.|.' s ' 1.2. ",
"3.4.0 u 5.6.7.' ' 8.. + @ ].{ 9.0.a.b.c.c.d.e.f.' g.. ",
"@ L 2 ` h.' ' ' ' i.@ j.L #.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y. ",
"3.4.; 3 z.A.B.C.C.D.^.3 E.F.G.H.I.J.K.L.M.N.O.P.Q.R.S.T.U. ",
"! & ].L M ( V.W.n.X.Y.Z.`.I. +.+++@+#+L.$+%+&+*+=+-+;+>+,+ ",
"$ # ].L f '+)+!+~+{+]+^+/+(+_+:+<+[+}+|+1+2+3+4+5+6+7+8+9+0+ ",
"o 4.a+b+c+d+e+f+g+h+h+i+j+9.k+l+m+n+o+p+q+r+s+t+u+v+7+w+x+y+z+ ",
"Z a+A+d+B+C+D+E+F+G+H+I+J+K+L+M+N+O+P+$+Q+R+S+4+T+U+V+w+W+X+Y+ ",
"1 *.Z+`+ @.@+@@@#@$@%@&@*@=@-@;@>@,@'@)@!@~@{@]@^@/@(@8+_@:@<@ ",
"- 2 [@}@|@1@2@3@4@5@6@7@8@9@0@a@b@#+c@d@e@f@{@g@h@i@j@k@l@:@m@ ",
"L 0.n@o@d+1@p@q@r@s@t@u@v@9@w@a@x@y@z@A@r+3+{@P.B@C@D@E@F@G@H@ ",
"^.0.I@c+J@1@p@K@r@s@t@L@v@M@N@M+O@P@Q@R@S@T@S+P.B@C@U@V@W@X@Y@ ",
"^.0.I@c+J@1@p@q@r@s@t@u@v@9@Z@`@ #.#+#@###R+$#P.%#&#U@*#=#-#;# ",
"^.0.I@c+J@1@2@3@4@5@6@7@8@9@>#,#'#)#o+p+q+S@!#~#%#{#U@]#^#/#(# ",
"^.0.I@c+J@1@2@_#:#<#[#}#|#1#2#3#4#b@5#L.6#7#8#S+9#C@0#a#8+b#c# ",
"L 3 d#Z+e#1@f#g#K@h#s@i#7@|#1#j#k#l#m#n#z@o#p#T@]@q#r#s#t#u# ",
"- *.f I@Z+1@v#w#3@x#<#y#t@7@|#z#A#B#C#P@+#D#E#F#G#H#I#J#K# ",
"1 <.3 f d#L#2@M#x#h#5@H+t@u@N#O#P#Q#R#S#T#U#V#2+W#t+X#Y#. ",
"Z { <.*.3 Z#`# $u@.$1#+$@$#$v#$$%$:.&$*$=$-$;$>$,$'$)$. ",
"o Z 1 - L ^.^.^.a+^.0 L { :.> ~ 4.Z Z j.[ o & $ e + . ",
"$ # [ ].Z Z Z Z 4.4.Z Z j.[ % % % o o # & $ 3.e + . . "};

View File

@@ -1,213 +0,0 @@
/* XPM */
static char * dynamicaCreatePinConstraint_xpm[] = {
"32 32 178 2",
" c #B1B1B1",
". c #A8A8A8",
"+ c #A5A5A5",
"@ c #718172",
"# c #6D866F",
"$ c #999999",
"% c #9B9B9B",
"& c #7B9B7E",
"* c #77CF80",
"= c #69846C",
"- c #8F8F8F",
"; c #989898",
"> c #82A185",
", c #88EC91",
"' c #57DD63",
") c #529C59",
"! c #878787",
"~ c #A2A2A2",
"{ c #949494",
"] c #88AA8B",
"^ c #8EED97",
"/ c #58E465",
"( c #23DC34",
"_ c #30B33C",
": c #667A68",
"< c #959595",
"[ c #9E9E9E",
"} c #757C76",
"| c #9BD9A1",
"1 c #87EC90",
"2 c #4BE259",
"3 c #17DA29",
"4 c #04D718",
"5 c #13C624",
"6 c #528C57",
"7 c #8B8B8B",
"8 c #A9A9A9",
"9 c #A6A6A6",
"0 c #717371",
"a c #99CB9E",
"b c #9BEFA3",
"c c #6FE87A",
"d c #30DE40",
"e c #09D71C",
"f c #00D614",
"g c #33A73E",
"h c #8E8E8E",
"i c #93BB97",
"j c #A3F0AA",
"k c #82EB8C",
"l c #49E257",
"m c #15D927",
"n c #01D615",
"o c #28B235",
"p c #419B49",
"q c #508D56",
"r c #9F9F9F",
"s c #89A68C",
"t c #A6F1AD",
"u c #8DED96",
"v c #59E466",
"w c #21DB32",
"x c #24B532",
"y c #858585",
"z c #969696",
"A c #929292",
"B c #809281",
"C c #A7EBAD",
"D c #94EE9C",
"E c #67E773",
"F c #2DDD3D",
"G c #06D119",
"H c #5E8061",
"I c #A0A0A0",
"J c #919191",
"K c #8A8A8A",
"L c #778278",
"M c #A0E2A6",
"N c #99EFA1",
"O c #73E87E",
"P c #3BDF4A",
"Q c #10D923",
"R c #36A441",
"S c #BE0000",
"T c #A20000",
"U c #7C1D14",
"V c #88744E",
"W c #877D52",
"X c #8B8F5F",
"Y c #95CA89",
"Z c #77E982",
"` c #46E155",
" . c #03D617",
".. c #13C424",
"+. c #69766B",
"@. c #AAAAAA",
"#. c #747D74",
"$. c #94D79B",
"%. c #86EC8F",
"&. c #7EEA88",
"*. c #6DE878",
"=. c #47E155",
"-. c #1CDB2E",
";. c #4C9053",
">. c #75C27C",
",. c #7AEA84",
"'. c #74E97F",
"). c #68E774",
"!. c #5AE467",
"~. c #4CE25A",
"{. c #38DF48",
"]. c #1DDB2F",
"^. c #07D71A",
"/. c #23B631",
"(. c #848484",
"_. c #66896A",
":. c #49C955",
"<. c #35DF45",
"[. c #2BDD3C",
"}. c #22DB33",
"|. c #1ADA2C",
"1. c #11D924",
"2. c #09CE1C",
"3. c #5D8160",
"4. c #69786A",
"5. c #32B03E",
"6. c #02D616",
"7. c #2BAF37",
"8. c #898989",
"9. c #A4A4A4",
"0. c #7F7F7F",
"a. c #399141",
"b. c #06D019",
"c. c #24B631",
"d. c #A7A7A7",
"e. c #AFAFAF",
"f. c #BDBDBD",
"g. c #528156",
"h. c #12C223",
"i. c #14C424",
"j. c #6C746C",
"k. c #AEAEAE",
"l. c #EBEBEB",
"m. c #F4F4F4",
"n. c #C2C2C2",
"o. c #697A6A",
"p. c #26AE33",
"q. c #09CE1B",
"r. c #627D64",
"s. c #A3A3A3",
"t. c #C7C7C7",
"u. c #FCFCFC",
"v. c #E6E6E6",
"w. c #DFDFDF",
"x. c #409C48",
"y. c #04D217",
"z. c #6E726F",
"A. c #B0B0B0",
"B. c #F8F8F8",
"C. c #8D8D8D",
"D. c #528B57",
"E. c #1BA610",
"F. c #5B835F",
"G. c #DDDDDD",
"H. c #EAEAEA",
"I. c #880000",
"J. c #B5B5B5",
"K. c #DEDEDE",
"L. c #E9E9E9",
"M. c #A1A1A1",
"N. c #CACACA",
"O. c #DCDCDC",
"P. c #ACACAC",
"Q. c #D8D8D8",
"R. c #C6C6C6",
"S. c #ADADAD",
"T. c #BA0000",
"U. c #BB0000",
" ",
" . + ",
" . @ # $ ",
" % & * = - ",
" ; > , ' ) ! ~ ",
" { ] ^ / ( _ : < ",
" [ } | 1 2 3 4 5 6 7 8 ",
" 9 0 a b c d e f f f g h ",
" 7 i j k l m n f o p q r ",
" h s t u v w 4 f x y z r ",
" A B C D E F e f G H I ",
" 8 J - K L M N O P Q n f R h ",
" S S S S S S S S T U V W X Y D Z ` 3 .f ..+.@. ",
" S I #.$.N ^ %.&.*.=.-.4 f f ;.z ",
" S y >.,.'.).!.~.{.].^.f f /.(. ",
" S I _.:.<.[.}.|.1.^.n f 2.3.r ",
" S ; 4.5.^.4 4 6.n f f 7.8. ",
" S 9.0.a.b.f f f f f c.y ",
" S d.e.f.g.h.f f f f i.j.k. ",
" S e.; l.m.n.o.p.f f f q.r.8 ",
" S s.t.u.v.w.; (.x.y.f /.z.A. ",
" S @.~ B.v.w.9 9.A.C.D.E.F.r ",
" S r G.H.w.9.9. $ I.$ ",
" S + J.m.K.s.9. S ",
" S k.$ L.G.M.9. S ",
" S s.N.O.I + S ",
" S P.+ Q.r + S ",
" S ~ R.r 9 S ",
" S S.s.[ P. S ",
" S S S S T.U.S S S S S S S S S S S S ",
" ",
" "};

View File

@@ -1,114 +0,0 @@
/* XPM */
static char * dynamicaCreateActiveBoxRB_xpm[] = {
"32 32 79 1",
" c #A47D7D",
". c #A53030",
"+ c #AA2424",
"@ c #AD5E5E",
"# c #B1B1B1",
"$ c #880202",
"% c #A61B1B",
"& c #A80101",
"* c #AD5A5A",
"= c #850000",
"- c #C30000",
"; c #B1ADAD",
"> c #A88C8C",
", c #860202",
"' c #A17070",
") c #A17373",
"! c #898989",
"~ c #969696",
"{ c #9C9C9C",
"] c #A7A7A7",
"^ c #0F0F0F",
"/ c #707070",
"( c #ABABAB",
"_ c #737373",
": c #2C2C2C",
"< c #000000",
"[ c #8E8E8E",
"} c #7F7F7F",
"| c #080808",
"1 c #6E6E6E",
"2 c #0C0C0C",
"3 c #A2A2A2",
"4 c #4F4F4F",
"5 c #212121",
"6 c #ADADAD",
"7 c #494949",
"8 c #4B4B4B",
"9 c #606060",
"0 c #131313",
"a c #060606",
"b c #1D1D1D",
"c c #7D7D7D",
"d c #858585",
"e c #929292",
"f c #A0A0A0",
"g c #797979",
"h c #626262",
"i c #6C6C6C",
"j c #414141",
"k c #454545",
"l c #2A2A2A",
"m c #434343",
"n c #7C7C7C",
"o c #5A5A5A",
"p c #121212",
"q c #2F2F2F",
"r c #141414",
"s c #686868",
"t c #A9A9A9",
"u c #818181",
"v c #5C5C5C",
"w c #646464",
"x c #2D2D2D",
"y c #050505",
"z c #151515",
"A c #575757",
"B c #636363",
"C c #555555",
"D c #6A6A6A",
"E c #3C3C3C",
"F c #111111",
"G c #666666",
"H c #090909",
"I c #515151",
"J c #5B5B5B",
"K c #5F5F5F",
"L c #616161",
"M c #A5A5A5",
"N c #959595",
" .+++++++++++++@################",
" $%&&&&&&&&&&&&&*###############",
" =$%&&&&&&&&&&&&&*##############",
" ==$%&&&&&&&&&&&&&*#############",
" ===$--------------;############",
" ====--------------#############",
" ====--------------#############",
" ====--------------#############",
" ====--------------#############",
" ====--------------#############",
" ====--------------#############",
" ====--------------#############",
" ====--------------#############",
">,===--------------#############",
"#',==--------------#############",
"##),=--------------#############",
"###),--------------#############",
"####)--------------#############",
"##########!###############~{####",
"#########]^/###########(_:<[####",
"##########}|~#########12<<<3####",
"###########456########67<<|#####",
"###########658#########90ab#####",
"############~|c#######da[e8#####",
"#############/^fgh###f^i########",
"##############j0<k##6lm#########",
"#niiiiiiiiiiiop<<5iiqrsiii1t####",
"#uvwwwwwwwwwhxy<<zwmaAwwwwBCt###",
"##uvsDDDDDDDDDwEF2GH8DDDDDDsCt##",
"###uvsDDDDDDDDDDDIDBDDDDDDDDsC##",
"####uJKKKKKKKKKKKKKKKKKKKKKKKKL#",
"#####MNNNNNNNNNNNNNNNNNNNNNNNN##"};

View File

@@ -1,100 +0,0 @@
/* XPM */
static char * dynamicaCreateActiveBoxRBArray_xpm[] = {
"32 32 65 1",
" c #B1B1B1",
". c #BE0000",
"+ c #898989",
"@ c #969696",
"# c #9C9C9C",
"$ c #A7A7A7",
"% c #0F0F0F",
"& c #707070",
"* c #ABABAB",
"= c #737373",
"- c #2C2C2C",
"; c #000000",
"> c #8E8E8E",
", c #7F7F7F",
"' c #080808",
") c #6E6E6E",
"! c #0C0C0C",
"~ c #A2A2A2",
"{ c #4F4F4F",
"] c #212121",
"^ c #ADADAD",
"/ c #494949",
"( c #4B4B4B",
"_ c #606060",
": c #131313",
"< c #060606",
"[ c #1D1D1D",
"} c #7D7D7D",
"| c #858585",
"1 c #929292",
"2 c #A0A0A0",
"3 c #797979",
"4 c #626262",
"5 c #6C6C6C",
"6 c #414141",
"7 c #454545",
"8 c #2A2A2A",
"9 c #434343",
"0 c #7C7C7C",
"a c #5A5A5A",
"b c #121212",
"c c #2F2F2F",
"d c #141414",
"e c #686868",
"f c #A9A9A9",
"g c #818181",
"h c #5C5C5C",
"i c #646464",
"j c #2D2D2D",
"k c #050505",
"l c #151515",
"m c #575757",
"n c #636363",
"o c #555555",
"p c #6A6A6A",
"q c #3C3C3C",
"r c #111111",
"s c #666666",
"t c #090909",
"u c #515151",
"v c #5B5B5B",
"w c #5F5F5F",
"x c #616161",
"y c #A5A5A5",
"z c #959595",
" ",
" ",
" ",
" ....... ....... ",
" . . . . ",
" . . . . ",
" . . . . ",
" . . . . ",
" . . . . ",
" ....... ....... ",
" ",
" ....... ....... ",
" . . . . ",
" . . . . ",
" . . . . ",
" . . . . ",
" . . . . ",
" ....... ....... ",
" + @# ",
" $%& *=-;> ",
" ,'@ )!;;;~ ",
" {]^ ^/;;' ",
" ^]( _:<[ ",
" @'} |<>1( ",
" &%234 2%5 ",
" 6:;7 ^89 ",
" 055555555555ab;;]55cde555)f ",
" ghiiiiiiiii4jk;;li9<miiiinof ",
" ghepppppppppiqr!st(ppppppeof ",
" ghepppppppppppupnppppppppeo ",
" gvwwwwwwwwwwwwwwwwwwwwwwwwx ",
" yzzzzzzzzzzzzzzzzzzzzzzzz "};

View File

@@ -1,273 +0,0 @@
/* XPM */
static char * dynamicaCreateActiveHullRB_xpm[] = {
"32 32 238 2",
" c #B1B1B1",
". c #BB8C8C",
"+ c #BE8383",
"@ c #B89898",
"# c #B4A7A7",
"$ c #BB4E4E",
"% c #DD0505",
"& c #C81515",
"* c #D81010",
"= c #E20000",
"- c #D91F1F",
"; c #D43434",
"> c #CE4949",
", c #C56A6A",
"' c #BE8181",
") c #B89696",
"! c #B5A2A2",
"~ c #CC4F4F",
"{ c #DD0E0E",
"] c #AE2121",
"^ c #AB8888",
"/ c #ACACAC",
"( c #7A7A7A",
"_ c #8D8D8D",
": c #BB8E8E",
"< c #C17979",
"[ c #C66464",
"} c #CE4747",
"| c #D62C2C",
"1 c #DC1717",
"2 c #DA1D1D",
"3 c #D43232",
"4 c #CE4646",
"5 c #BC6161",
"6 c #AE6F6F",
"7 c #B28D8D",
"8 c #B69E9E",
"9 c #CD4B4B",
"0 c #DF0C0C",
"a c #B19999",
"b c #686868",
"c c #ABABAB",
"d c #C4C4C4",
"e c #727272",
"f c #6A6A6A",
"g c #6E6E6E",
"h c #717171",
"i c #7C7C7C",
"j c #A3A3A3",
"k c #BA9090",
"l c #A56060",
"m c #8F2F2F",
"n c #AE2626",
"o c #C21B1B",
"p c #D50909",
"q c #D32D2D",
"r c #B79A9A",
"s c #DE0F0F",
"t c #C65151",
"u c #867676",
"v c #666666",
"w c #595959",
"x c #B6B6B6",
"y c #9F9F9F",
"z c #999999",
"A c #959595",
"B c #8A8A8A",
"C c #797979",
"D c #5D5D5D",
"E c #A1A1A1",
"F c #AEAEAE",
"G c #7D7D7D",
"H c #C81111",
"I c #BA7878",
"J c #B2ADAD",
"K c #DC1414",
"L c #B95252",
"M c #8B7E7E",
"N c #5A5A5A",
"O c #919191",
"P c #C2C2C2",
"Q c #CACACA",
"R c #C7C7C7",
"S c #C3C3C3",
"T c #C0C0C0",
"U c #BDBDBD",
"V c #B9B9B9",
"W c #B7B7B7",
"X c #B5B5B5",
"Y c #696969",
"Z c #8F8F8F",
"` c #6D6D6D",
" . c #969696",
".. c #767676",
"+. c #965B5B",
"@. c #D91C1C",
"#. c #937373",
"$. c #D20A0A",
"%. c #888888",
"&. c #BBBBBB",
"*. c #CDCDCD",
"=. c #CCCCCC",
"-. c #C8C8C8",
";. c #C5C5C5",
">. c #C1C1C1",
",. c #BEBEBE",
"'. c #B4B4B4",
"). c #B3B3B3",
"!. c #9C9C9C",
"~. c #676767",
"{. c #A8A8A8",
"]. c #B0B0B0",
"^. c #616161",
"/. c #C37070",
"(. c #855050",
"_. c #D82B2B",
":. c #A7A7A7",
"<. c #B2B2B2",
"[. c #6C6C6C",
"}. c #818181",
"|. c #808080",
"1. c #946A6A",
"2. c #DC1515",
"3. c #B25D5D",
"4. c #DF1414",
"5. c #575454",
"6. c #CBCBCB",
"7. c #BABABA",
"8. c #B8B8B8",
"9. c #9E9E9E",
"0. c #7F7F7F",
"a. c #656565",
"b. c #C93939",
"c. c #C76060",
"d. c #6D6B6B",
"e. c #DC2D2D",
"f. c #924545",
"g. c #828282",
"h. c #A2A2A2",
"i. c #634848",
"j. c #DE0C0C",
"k. c #B3A9A9",
"l. c #9E5454",
"m. c #D42A2A",
"n. c #C6C6C6",
"o. c #BC3A3A",
"p. c #CF4343",
"q. c #8D8A8A",
"r. c #D50B0B",
"s. c #C49F9F",
"t. c #9F4D4D",
"u. c #DD1313",
"v. c #AA3D3D",
"w. c #C13F3F",
"x. c #A0A0A0",
"y. c #A05353",
"z. c #9B8686",
"A. c #DA0808",
"B. c #BCB1B1",
"C. c #5E5E5E",
"D. c #A55D5D",
"E. c #DD1111",
"F. c #BA9292",
"G. c #BE2929",
"H. c #B24242",
"I. c #B5B2B2",
"J. c #626262",
"K. c #9E5C5C",
"L. c #B48989",
"M. c #CA1C1C",
"N. c #D30E0E",
"O. c #BA5F5F",
"P. c #A5A5A5",
"Q. c #858585",
"R. c #9D6060",
"S. c #9E6B6B",
"T. c #BB1919",
"U. c #D70C0C",
"V. c #AB4C4C",
"W. c #8E7E7E",
"X. c #9A6D6D",
"Y. c #9E5E5E",
"Z. c #A34949",
"`. c #A83333",
" + c #AB2323",
".+ c #CA1D1D",
"++ c #D62121",
"@+ c #E10404",
"#+ c #BD8787",
"$+ c #9C7272",
"%+ c #C22929",
"&+ c #E10101",
"*+ c #CD1818",
"=+ c #C82121",
"-+ c #BE3737",
";+ c #BE4C4C",
">+ c #C06666",
",+ c #898989",
"'+ c #0F0F0F",
")+ c #707070",
"!+ c #737373",
"~+ c #2C2C2C",
"{+ c #000000",
"]+ c #8E8E8E",
"^+ c #080808",
"/+ c #0C0C0C",
"(+ c #4F4F4F",
"_+ c #212121",
":+ c #ADADAD",
"<+ c #494949",
"[+ c #4B4B4B",
"}+ c #606060",
"|+ c #131313",
"1+ c #060606",
"2+ c #1D1D1D",
"3+ c #929292",
"4+ c #414141",
"5+ c #454545",
"6+ c #2A2A2A",
"7+ c #434343",
"8+ c #121212",
"9+ c #2F2F2F",
"0+ c #141414",
"a+ c #A9A9A9",
"b+ c #5C5C5C",
"c+ c #646464",
"d+ c #2D2D2D",
"e+ c #050505",
"f+ c #151515",
"g+ c #575757",
"h+ c #636363",
"i+ c #555555",
"j+ c #3C3C3C",
"k+ c #111111",
"l+ c #090909",
"m+ c #515151",
"n+ c #5B5B5B",
"o+ c #5F5F5F",
" . + @ ",
" # $ % & * = - ; > , ' ) ",
" ! ~ { ] ^ / ( _ : < [ } | 1 = 2 3 4 5 6 7 ",
" 8 9 0 9 a b c d e b f g h i j k l m n o p q ",
" r } s t u v w h / d x j y z A B C A D E F G H I ",
"J K L M N O P Q R S T U V W X X Y Z ` . ..+.@. ",
"#.$.e %.&.*.=.Q -.;.>.,.&.W X '.).!.~.{.N ].E ^.3 /. ",
"(._.:.E *.=.Q -.;.P ,.&.V X ).<. [.( }. |.1.2.J ",
"3.4.5.b *.6.-.;.P ,.7.8.x ). 9.0.]. a.b.c. ",
"d.e.f.g.Q -.;.P ,.V x '.<. h.i.j.k. ",
"C l.m.c n.d T U V '. g o.p. ",
" q.r.s.>.,.&.W ). c ..t.u.r ",
" v.w.U 7.W ). x.D y.u.) ",
" z.A.B.W '. {.C.D.E.F. ",
" G.H.I. :.J.K.s : ",
" L.M.N.O.J P.Q.N R.0 . ",
" S.T.U.V.W.X.Y.Z.`. +.+++@+#+ ",
" c $+%+&+*+=+-+;+>+' : J ",
" ,+ .!. ",
" :.'+)+ c !+~+{+]+ ",
" 0.^+ . g /+{+{+{+h. ",
" (+_+:+ :+<+{+{+^+ ",
" :+_+[+ }+|+1+2+ ",
" .^+G Q.1+]+3+[+ ",
" )+'+x.C J. x.'+[. ",
" 4+|+{+5+ :+6+7+ ",
" i [.[.[.[.[.[.[.[.[.[.[.N 8+{+{+_+[.[.9+0+b [.[.[.g a+ ",
" }.b+c+c+c+c+c+c+c+c+c+J.d+e+{+{+f+c+7+1+g+c+c+c+c+h+i+a+ ",
" }.b+b f f f f f f f f f c+j+k+/+v l+[+f f f f f f b i+a+ ",
" }.b+b f f f f f f f f f f f m+f h+f f f f f f f f b i+ ",
" }.n+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+o+^. ",
" P.A A A A A A A A A A A A A A A A A A A A A A A A "};

View File

@@ -1,145 +0,0 @@
/* XPM */
static char * dynamicaCreateActiveHullRBArray_xpm[] = {
"32 32 110 2",
" c #B1B1B1",
". c #B3ABAB",
"+ c #C17777",
"@ c #CA5757",
"# c #C66464",
"$ c #C27272",
"% c #BD8484",
"& c #B99595",
"* c #B5A2A2",
"= c #B3A9A9",
"- c #CB5454",
"; c #C37070",
"> c #B79A9A",
", c #BE8383",
"' c #C27575",
") c #C76363",
"! c #C95C5C",
"~ c #C85E5E",
"{ c #C76262",
"] c #C56A6A",
"^ c #BB8E8E",
"/ c #CA5555",
"( c #C27474",
"_ c #B4A5A5",
": c #B3AAAA",
"< c #CE4747",
"[ c #C95B5B",
"} c #B89696",
"| c #BE8080",
"1 c #B89797",
"2 c #BC8A8A",
"3 c #C66767",
"4 c #C36E6E",
"5 c #B2AEAE",
"6 c #CA5858",
"7 c #B4A7A7",
"8 c #BF7F7F",
"9 c #C95A5A",
"0 c #C07979",
"a c #BE8181",
"b c #C37171",
"c c #BD8585",
"d c #C17878",
"e c #C46C6C",
"f c #B3A8A8",
"g c #946464",
"h c #969696",
"i c #9C9C9C",
"j c #BD5757",
"k c #110707",
"l c #726B6B",
"m c #ABABAB",
"n c #737373",
"o c #2C2C2C",
"p c #000000",
"q c #8E8E8E",
"r c #7F7F7F",
"s c #080808",
"t c #6E6E6E",
"u c #0C0C0C",
"v c #A2A2A2",
"w c #4F4F4F",
"x c #212121",
"y c #ADADAD",
"z c #494949",
"A c #4B4B4B",
"B c #606060",
"C c #131313",
"D c #060606",
"E c #1D1D1D",
"F c #7D7D7D",
"G c #858585",
"H c #929292",
"I c #707070",
"J c #0F0F0F",
"K c #A0A0A0",
"L c #797979",
"M c #626262",
"N c #6C6C6C",
"O c #414141",
"P c #454545",
"Q c #2A2A2A",
"R c #434343",
"S c #7C7C7C",
"T c #5A5A5A",
"U c #121212",
"V c #2F2F2F",
"W c #141414",
"X c #686868",
"Y c #A9A9A9",
"Z c #818181",
"` c #5C5C5C",
" . c #646464",
".. c #2D2D2D",
"+. c #050505",
"@. c #151515",
"#. c #575757",
"$. c #636363",
"%. c #555555",
"&. c #6A6A6A",
"*. c #3C3C3C",
"=. c #111111",
"-. c #666666",
";. c #090909",
">. c #515151",
",. c #5B5B5B",
"'. c #5F5F5F",
"). c #616161",
"!. c #A5A5A5",
"~. c #959595",
" ",
" . + @ # $ % & * = ",
" = + - ; > & , ' ) ! ~ { ] ",
" ^ / ( _ : ^ < ",
" [ } ( | . + @ # $ % & * = ",
" @ 1 = / = = + - ; > & , ' ) ! ~ { ] ",
" 2 3 4 ; ^ / ( _ : ^ < ",
" 5 6 7 8 9 . [ } ( | ",
" 0 ) 7 a / : @ 1 = / = ",
" 5 ' - b c d e ! 6 f 2 3 4 ; ",
" 5 6 7 8 9 . ",
" . + @ # $ % & * = 0 ) 7 a / : ",
" = + - ; > & , ' ) ! ~ { ] 5 ' - b c d e ! 6 f ",
" ^ / ( _ : ^ < ",
" [ } ( | ",
" @ 1 = / = ",
" 2 3 4 ; ",
" 5 6 7 8 9 . ",
" 0 ) 7 g / : h i ",
" 5 ' - b c d e j k l m n o p q ",
" r s h t u p p p v ",
" w x y y z p p s ",
" y x A B C D E ",
" h s F G D q H A ",
" I J K L M K J N ",
" O C p P y Q R ",
" S N N N N N N N N N N N T U p p x N N V W X N N N t Y ",
" Z ` . . . . . . . . .M ..+.p p @. .R D #. . . . .$.%.Y ",
" Z ` X &.&.&.&.&.&.&.&.&. .*.=.u -.;.A &.&.&.&.&.&.X %.Y ",
" Z ` X &.&.&.&.&.&.&.&.&.&.&.>.&.$.&.&.&.&.&.&.&.&.X %. ",
" Z ,.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.). ",
" !.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~. "};

View File

@@ -1,247 +0,0 @@
/* XPM */
static char * dynamicaCreateActiveMeshRB_xpm[] = {
"32 32 212 2",
" c #B1B1B1",
". c #A7A7A7",
"+ c #989898",
"@ c #939393",
"# c #A2A2A2",
"$ c #AFAFAF",
"% c #918888",
"& c #BC5B5B",
"* c #C34949",
"= c #A56969",
"- c #A3A3A3",
"; c #ABABAB",
"> c #A8A8A8",
", c #AEAEAE",
"' c #959595",
") c #C35858",
"! c #D13D3D",
"~ c #A07171",
"{ c #969696",
"] c #979797",
"^ c #9C9C9C",
"/ c #ACACAC",
"( c #8C8B8B",
"_ c #957777",
": c #996B6B",
"< c #918080",
"[ c #ADADAD",
"} c #9E9E9E",
"| c #949494",
"1 c #A07C7C",
"2 c #C35A5A",
"3 c #D23E3E",
"4 c #C93B3B",
"5 c #BD4141",
"6 c #BA3C3C",
"7 c #B63939",
"8 c #B33B3B",
"9 c #AD4848",
"0 c #9B9B9B",
"a c #A6A6A6",
"b c #937E7E",
"c c #BA2020",
"d c #C10404",
"e c #A54C4C",
"f c #908282",
"g c #A0A0A0",
"h c #B37272",
"i c #C76464",
"j c #D15959",
"k c #D65151",
"l c #D44848",
"m c #D13C3C",
"n c #CF3131",
"o c #CC2626",
"p c #C91B1B",
"q c #C71212",
"r c #C60E0E",
"s c #C60D0D",
"t c #9A6E6E",
"u c #A4A4A4",
"v c #B42D2D",
"w c #C30000",
"x c #A15757",
"y c #A1A1A1",
"z c #8F8989",
"A c #A07D7D",
"B c #AE7676",
"C c #CD6565",
"D c #D85B5B",
"E c #D75757",
"F c #D65252",
"G c #D54C4C",
"H c #D34242",
"I c #CF3535",
"J c #CD2B2B",
"K c #CB2020",
"L c #C81515",
"M c #C60C0C",
"N c #C50909",
"O c #C50707",
"P c #B72323",
"Q c #917F7F",
"R c #C20202",
"S c #BA1717",
"T c #929292",
"U c #9B7F7F",
"V c #CB5A5A",
"W c #C16767",
"X c #BE6D6D",
"Y c #D95D5D",
"Z c #D85959",
"` c #D34343",
" . c #D03737",
".. c #CB2222",
"+. c #C91919",
"@. c #C40606",
"#. c #C30202",
"$. c #9C6464",
"%. c #A84646",
"&. c #A74848",
"*. c #9F9F9F",
"=. c #B66565",
"-. c #D25050",
";. c #8D8D8D",
">. c #9A8383",
",. c #D85A5A",
"'. c #D75454",
"). c #D03838",
"!. c #CD2929",
"~. c #CA1E1E",
"{. c #C81717",
"]. c #C71010",
"^. c #B81B1B",
"/. c #976F6F",
"(. c #A9A9A9",
"_. c #9C7B7B",
":. c #D44949",
"<. c #9A8080",
"[. c #AB7575",
"}. c #D75353",
"|. c #CD2A2A",
"1. c #C60B0B",
"2. c #C40303",
"3. c #BA1616",
"4. c #8D8A8A",
"5. c #A76E6E",
"6. c #C35353",
"7. c #C35757",
"8. c #D34545",
"9. c #CF3232",
"0. c #CC2727",
"a. c #9D6262",
"b. c #9C7878",
"c. c #CD3B3B",
"d. c #CF3434",
"e. c #C81414",
"f. c #C00808",
"g. c #A15656",
"h. c #9A9A9A",
"i. c #B45252",
"j. c #C71313",
"k. c #BA1818",
"l. c #937A7A",
"m. c #9D9D9D",
"n. c #9F6D6D",
"o. c #BE0E0E",
"p. c #937979",
"q. c #AA5151",
"r. c #BD0F0F",
"s. c #967373",
"t. c #9C6565",
"u. c #B91A1A",
"v. c #BC1212",
"w. c #AA4141",
"x. c #8F8383",
"y. c #A94242",
"z. c #AB3C3C",
"A. c #A35252",
"B. c #9A6969",
"C. c #898989",
"D. c #0F0F0F",
"E. c #707070",
"F. c #737373",
"G. c #2C2C2C",
"H. c #000000",
"I. c #8E8E8E",
"J. c #7F7F7F",
"K. c #080808",
"L. c #6E6E6E",
"M. c #0C0C0C",
"N. c #4F4F4F",
"O. c #212121",
"P. c #494949",
"Q. c #4B4B4B",
"R. c #606060",
"S. c #131313",
"T. c #060606",
"U. c #1D1D1D",
"V. c #7D7D7D",
"W. c #858585",
"X. c #797979",
"Y. c #626262",
"Z. c #6C6C6C",
"`. c #414141",
" + c #454545",
".+ c #2A2A2A",
"++ c #434343",
"@+ c #7C7C7C",
"#+ c #5A5A5A",
"$+ c #121212",
"%+ c #2F2F2F",
"&+ c #141414",
"*+ c #686868",
"=+ c #818181",
"-+ c #5C5C5C",
";+ c #646464",
">+ c #2D2D2D",
",+ c #050505",
"'+ c #151515",
")+ c #575757",
"!+ c #636363",
"~+ c #555555",
"{+ c #6A6A6A",
"]+ c #3C3C3C",
"^+ c #111111",
"/+ c #666666",
"(+ c #090909",
"_+ c #515151",
":+ c #5B5B5B",
"<+ c #5F5F5F",
"[+ c #616161",
"}+ c #A5A5A5",
" ",
" . + @ # ",
" $ % & * = - ; > , ",
" $ ' ) ! ~ ' { ] + ^ / # ( _ : < , ",
" [ } | % 1 2 3 4 5 6 7 8 9 0 a b c d e f , ",
" $ . g % h i j k l m n o p q r s t u ] v w x ^ , ",
"y z A B C D E F G H I J K L M N O P ' , Q R S T ",
"U V W X Y Z F G ` .J ..+.r @.#.w w $.^ %.w &.*. ",
"=.-.;.>.,.'.G ` ).!.~.{.].@.w w w w ^.&.R w /.(. ",
"_.:.<.[.}.G H .|.p ].1.2.w w w w w w w w 3.4. ",
"0 5.6.7.8.! 9.0.+.N w w w w w w w w w w w a.y ",
" - b.c.d.J K e.@.w w w w w w w w w w f.g.0 ",
" h.i.0.~.j.@.w w w w w w w w w w k.l.m. ",
" a n.~.e.N w w w w w w w w w w o.p.# ",
" 0 q.1.w w w w w w w w w w r.s.*. ",
" , 0 t.u.w w w w w w w v.w.Q *. ",
" # x.x y.z.z.y.A.B.f m./ ",
" $ - } ^ ^ } # > , ",
" C. { ^ ",
" . D.E. ; F.G.H.I. ",
" J.K.{ L.M.H.H.H.# ",
" N.O.[ [ P.H.H.K. ",
" [ O.Q. R.S.T.U. ",
" { K.V. W.T.I.T Q. ",
" E.D.g X.Y. g D.Z. ",
" `.S.H. + [ .+++ ",
" @+Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.#+$+H.H.O.Z.Z.%+&+*+Z.Z.Z.L.(. ",
" =+-+;+;+;+;+;+;+;+;+;+Y.>+,+H.H.'+;+++T.)+;+;+;+;+!+~+(. ",
" =+-+*+{+{+{+{+{+{+{+{+{+;+]+^+M./+(+Q.{+{+{+{+{+{+*+~+(. ",
" =+-+*+{+{+{+{+{+{+{+{+{+{+{+_+{+!+{+{+{+{+{+{+{+{+*+~+ ",
" =+:+<+<+<+<+<+<+<+<+<+<+<+<+<+<+<+<+<+<+<+<+<+<+<+<+[+ ",
" }+' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' "};

View File

@@ -1,174 +0,0 @@
/* XPM */
static char * dynamicaCreateActiveMeshRBArray_xpm[] = {
"32 32 139 2",
" c #B1B1B1",
". c #A2A2A2",
"+ c #929292",
"@ c #AFAFAF",
"# c #B0B0B0",
"$ c #ABABAB",
"% c #ACACAC",
"& c #ADADAD",
"* c #928787",
"= c #C75252",
"- c #9E7777",
"; c #8F8888",
"> c #8E8888",
", c #A4A4A4",
"' c #947777",
") c #947878",
"! c #A9A9A9",
"~ c #A0A0A0",
"{ c #948787",
"] c #AA7878",
"^ c #BB6868",
"/ c #D24A4A",
"( c #CA4141",
"_ c #C33939",
": c #BE2E2E",
"< c #996E6E",
"[ c #A5A5A5",
"} c #9E5E5E",
"| c #B62020",
"1 c #957474",
"2 c #A7A7A7",
"3 c #9C7E7E",
"4 c #AE7373",
"5 c #CB6262",
"6 c #D75757",
"7 c #D65050",
"8 c #D24141",
"9 c #CE2D2D",
"0 c #C81616",
"a c #C30000",
"b c #B32929",
"c c #B52323",
"d c #A25454",
"e c #989898",
"f c #BC5C5C",
"g c #A77474",
"h c #CC5555",
"i c #D54B4B",
"j c #C71212",
"k c #C10404",
"l c #B32828",
"m c #BE0D0D",
"n c #917F7F",
"o c #AEAEAE",
"p c #9A7B7B",
"q c #B75A5A",
"r c #CF3F3F",
"s c #CF3535",
"t c #CC2525",
"u c #C60B0B",
"v c #A84646",
"w c #9E9E9E",
"x c #9E7272",
"y c #CC2626",
"z c #C91919",
"A c #C40404",
"B c #C30101",
"C c #A35252",
"D c #8C8B8B",
"E c #8D8A8A",
"F c #B03F3F",
"G c #A35151",
"H c #9B9B9B",
"I c #A15656",
"J c #B22A2A",
"K c #B52424",
"L c #B22C2C",
"M c #A94141",
"N c #976F6F",
"O c #9C9C9C",
"P c #A3A3A3",
"Q c #979797",
"R c #969696",
"S c #9D9D9D",
"T c #937777",
"U c #898686",
"V c #797979",
"W c #9F9F9F",
"X c #0F0F0F",
"Y c #707070",
"Z c #737373",
"` c #2C2C2C",
" . c #000000",
".. c #8E8E8E",
"+. c #7F7F7F",
"@. c #080808",
"#. c #6E6E6E",
"$. c #0C0C0C",
"%. c #4F4F4F",
"&. c #212121",
"*. c #494949",
"=. c #4B4B4B",
"-. c #606060",
";. c #131313",
">. c #060606",
",. c #1D1D1D",
"'. c #7D7D7D",
"). c #858585",
"!. c #626262",
"~. c #6C6C6C",
"{. c #414141",
"]. c #454545",
"^. c #2A2A2A",
"/. c #434343",
"(. c #7C7C7C",
"_. c #5A5A5A",
":. c #121212",
"<. c #2F2F2F",
"[. c #141414",
"}. c #686868",
"|. c #818181",
"1. c #5C5C5C",
"2. c #646464",
"3. c #2D2D2D",
"4. c #050505",
"5. c #151515",
"6. c #575757",
"7. c #636363",
"8. c #555555",
"9. c #6A6A6A",
"0. c #3C3C3C",
"a. c #111111",
"b. c #666666",
"c. c #090909",
"d. c #515151",
"e. c #5B5B5B",
"f. c #5F5F5F",
"g. c #616161",
"h. c #959595",
" . + . @ # $ % ",
" & . * = - ; > . , ' ) % ",
" ! ~ { ] ^ / ( _ : < [ } | 1 $ ",
"2 3 4 5 6 7 8 9 0 a b > c d . ",
"e f g h i 8 9 j a a k l m n o . + . @ # $ % ",
"2 p q r s t u a a a a a v w & . * = - ; > . , ' ) % ",
" 2 x y z A a a a a B C D o ! ~ { ] ^ / ( _ : < [ } | 1 $ ",
" # E F a a a a a k G H 2 3 4 5 6 7 8 9 0 a b > c d . ",
" ! D I J K L M N O e f g h i 8 9 j a a k l m n o ",
" P Q R e S ! 2 p q r s t u a a a a a v w ",
" . + . @ # $ . x y z A a a a a B C D o ",
" & . * = - ; > . , ' T U F a a a a a k G H ",
" ! ~ { ] ^ / ( _ : < [ } | 1 P D I J K L M N O ",
"2 3 4 5 6 7 8 9 0 a b > c d . P Q R e S ! ",
"e f g h i 8 9 j a a k l m n o ",
"2 p q r s t u a a a a a v w ",
" 2 x y z A a a a a B C D o ",
" # E F a a a a a k G H ",
" ! D I J K L M N V R O ",
" P Q R e S W X Y $ Z ` ... ",
" +.@.R #.$. . . .. ",
" %.&.& & *. . .@. ",
" & &.=. -.;.>.,. ",
" R @.'. ).>...+ =. ",
" Y X ~ V !. ~ X ~. ",
" {.;. .]. & ^./. ",
" (.~.~.~.~.~.~.~.~.~.~.~._.:. . .&.~.~.<.[.}.~.~.~.#.! ",
" |.1.2.2.2.2.2.2.2.2.2.!.3.4. . .5.2./.>.6.2.2.2.2.7.8.! ",
" |.1.}.9.9.9.9.9.9.9.9.9.2.0.a.$.b.c.=.9.9.9.9.9.9.}.8.! ",
" |.1.}.9.9.9.9.9.9.9.9.9.9.9.d.9.7.9.9.9.9.9.9.9.9.}.8. ",
" |.e.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.g. ",
" [ h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h. "};

View File

@@ -1,55 +0,0 @@
/* XPM */
static char * dynamicaCreateActivePlaneRB_xpm[] = {
"32 32 20 1",
" c #B1B1B1",
". c #958F8F",
"+ c #8F8181",
"@ c #908383",
"# c #ACACAC",
"$ c #969595",
"% c #8B7171",
"& c #C52525",
"* c #C22828",
"= c #7C7C7C",
"- c #8A7272",
"; c #DC0909",
"> c #E40000",
", c #DB0B0B",
"' c #887373",
") c #867575",
"! c #986161",
"~ c #887B7B",
"{ c #AAAAAA",
"] c #A1A1A1",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" .++++++++++++++++++++++++@# ",
" $%&&&&&&&&&&&&&&&&&&&&&&&*=# ",
" $-;>>>>>>>>>>>>>>>>>>>>>>,=# ",
" $';>>>>>>>>>>>>>>>>>>>>>>,= ",
" $)!!!!!!!!!!!!!!!!!!!!!!!!~ ",
" {]]]]]]]]]]]]]]]]]]]]]]]] ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "};

View File

@@ -1,66 +0,0 @@
/* XPM */
static char * dynamicaCreateActivePlaneRBArray_xpm[] = {
"32 32 31 1",
" c #B1B1B1",
". c #928787",
"+ c #8B7D7D",
"@ c #8C7E7E",
"# c #8C7D7D",
"$ c #8F8181",
"% c #969696",
"& c #8D7E7E",
"* c #AE4141",
"= c #CB1E1E",
"- c #CC1D1D",
"; c #AC4444",
"> c #8D7F7F",
", c #ADADAD",
"' c #7F7B7B",
") c #E30101",
"! c #E40000",
"~ c #946666",
"{ c #959090",
"] c #948D8D",
"^ c #9C5C5C",
"/ c #DE0707",
"( c #807B7B",
"_ c #7D7B7B",
": c #986161",
"< c #956565",
"[ c #996060",
"} c #7F7A7A",
"| c #AFAFAF",
"1 c #A1A1A1",
"2 c #A2A2A2",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" .+@@@@@@@@@@@#$% ",
" &*===========-;> ",
" ,')!!!!!!!!!!!!~{ ",
" ]^!!!!!!!!!!!!/( ",
" _:<<<<<<<<<<<[}| ",
" 1222222222221| ",
" .+@@@@@@@@@@@#$% ",
" &*===========-;> ",
" ,')!!!!!!!!!!!!~{ ",
" ]^!!!!!!!!!!!!/( ",
" _:<<<<<<<<<<<[}| ",
" 1222222222221| ",
" .+@@@@@@@@@@@#$% ",
" &*===========-;> ",
" ,')!!!!!!!!!!!!~{ ",
" ]^!!!!!!!!!!!!/( ",
" _:<<<<<<<<<<<[}| ",
" 1222222222221| ",
" ",
" ",
" ",
" ",
" ",
" "};

View File

@@ -1,37 +0,0 @@
/* XPM */
static char * dynamicaCreateActiveRB_xpm[] = {
"32 32 2 1",
" c None",
". c #4E36E0",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................"};

View File

@@ -1,229 +0,0 @@
/* XPM */
static char * dynamicaCreateActiveSphereRB_xpm[] = {
"32 32 194 2",
" c #B1B1B1",
". c #B2AFAF",
"+ c #BAA2A2",
"@ c #BD9C9C",
"# c #BC9A9A",
"$ c #BB9696",
"% c #B69E9E",
"& c #B5ACAC",
"* c #C69696",
"= c #D18686",
"- c #D18181",
"; c #CF7E7E",
"> c #CC7777",
", c #C96D6D",
"' c #C46161",
") c #BE5A5A",
"! c #B57878",
"~ c #B1ABAB",
"{ c #BEA2A2",
"] c #D28989",
"^ c #D38787",
"/ c #D28484",
"( c #CE7C7C",
"_ c #CB7474",
": c #C76969",
"< c #C25A5A",
"[ c #BB4848",
"} c #B43434",
"| c #AC2D2D",
"1 c #AE8D8D",
"2 c #C19E9E",
"3 c #D38888",
"4 c #D08080",
"5 c #CE7A7A",
"6 c #CA7070",
"7 c #C56363",
"8 c #BE5151",
"9 c #B63B3B",
"0 c #AE2323",
"a c #A40A0A",
"b c #A20707",
"c c #AD8686",
"d c #BAA6A6",
"e c #D48989",
"f c #D28686",
"g c #D18383",
"h c #CC7676",
"i c #C86A6A",
"j c #C25B5B",
"k c #BA4545",
"l c #B02A2A",
"m c #A60E0E",
"n c #A10101",
"o c #A20F0F",
"p c #AF9E9E",
"q c #CE8E8E",
"r c #C96E6E",
"s c #BE4F4F",
"t c #B43535",
"u c #A81414",
"v c #A74343",
"w c #BDA2A2",
"x c #CB7272",
"y c #C56262",
"z c #BF5353",
"A c #B73E3E",
"B c #AC1F1F",
"C c #A10303",
"D c #AF9C9C",
"E c #C89494",
"F c #CF7D7D",
"G c #C66565",
"H c #B73D3D",
"I c #AE2525",
"J c #AA6666",
"K c #CC8989",
"L c #D18282",
"M c #C76767",
"N c #BE5050",
"O c #AC1E1E",
"P c #A20404",
"Q c #A74545",
"R c #CF8282",
"S c #C15858",
"T c #B73C3C",
"U c #AB1B1B",
"V c #A20505",
"W c #A63535",
"X c #CC7F7F",
"Y c #C35D5D",
"Z c #BC4A4A",
"` c #B02B2B",
" . c #A63939",
".. c #C87F7F",
"+. c #C86C6C",
"@. c #BD4C4C",
"#. c #A71111",
"$. c #A84949",
"%. c #BF8888",
"&. c #C45F5F",
"*. c #C05656",
"=. c #A91717",
"-. c #AB7373",
";. c #B69C9C",
">. c #BA4444",
",. c #B33232",
"'. c #AA1919",
"). c #A20909",
"!. c #B0A9A9",
"~. c #BA6767",
"{. c #B84040",
"]. c #B23030",
"^. c #A95A5A",
"/. c #B29F9F",
"(. c #B23636",
"_. c #A20303",
":. c #A42222",
"<. c #B0ABAB",
"[. c #AF8C8C",
"}. c #A40E0E",
"|. c #A31A1A",
"1. c #AE9292",
"2. c #A41E1E",
"3. c #B0A5A5",
"4. c #B1AFAF",
"5. c #AB6B6B",
"6. c #A52C2C",
"7. c #7D0101",
"8. c #A63737",
"9. c #AD8383",
"0. c #969696",
"a. c #9C9C9C",
"b. c #A48686",
"c. c #0E0C0C",
"d. c #6F5B5B",
"e. c #ABABAB",
"f. c #737373",
"g. c #2C2C2C",
"h. c #000000",
"i. c #8E8E8E",
"j. c #7F7F7F",
"k. c #080808",
"l. c #6E6E6E",
"m. c #0C0C0C",
"n. c #A2A2A2",
"o. c #4F4F4F",
"p. c #212121",
"q. c #ADADAD",
"r. c #494949",
"s. c #4B4B4B",
"t. c #606060",
"u. c #131313",
"v. c #060606",
"w. c #1D1D1D",
"x. c #7D7D7D",
"y. c #858585",
"z. c #929292",
"A. c #707070",
"B. c #0F0F0F",
"C. c #A0A0A0",
"D. c #797979",
"E. c #626262",
"F. c #6C6C6C",
"G. c #414141",
"H. c #454545",
"I. c #2A2A2A",
"J. c #434343",
"K. c #7C7C7C",
"L. c #5A5A5A",
"M. c #121212",
"N. c #2F2F2F",
"O. c #141414",
"P. c #686868",
"Q. c #A9A9A9",
"R. c #818181",
"S. c #5C5C5C",
"T. c #646464",
"U. c #2D2D2D",
"V. c #050505",
"W. c #151515",
"X. c #575757",
"Y. c #636363",
"Z. c #555555",
"`. c #6A6A6A",
" + c #3C3C3C",
".+ c #111111",
"++ c #666666",
"@+ c #090909",
"#+ c #515151",
"$+ c #5B5B5B",
"%+ c #5F5F5F",
"&+ c #616161",
"*+ c #A5A5A5",
"=+ c #959595",
" . + @ # $ % ",
" & * = - ; > , ' ) ! ~ ",
" { ] ^ / - ( _ : < [ } | 1 ",
" 2 3 3 ^ / 4 5 6 7 8 9 0 a b c ",
" d e 3 3 f g ; h i j k l m n n o p ",
" q 3 3 ^ / 4 5 r ' s t u n n n n v ",
" w 3 ^ ^ / - ( x y z A B n n n n n C D ",
" E f f / - F _ G s H I n n n n n n n J ",
" K g L 4 ( _ M N } O P n n n n n n n Q ",
" R 4 ; 5 _ : S T U V n n n n n n n n W ",
" X 5 > x i Y Z ` a n n n n n n n n n . ",
" ..x +.G j @.t #.n n n n n n n n n n $. ",
" %.M &.*.[ } =.n n n n n n n n n n n -. ",
" ;.j 8 >.,.'.n n n n n n n n n n n ).!. ",
" ~.{.].U n n n n n n n n n n n n ^. ",
" /.(.U _.n n n n n n n n n n n :.<. ",
" [.}.n n n n n n n n n n n |.p ",
" 1.2.n n n n n n n n n W 3. ",
" 4.5.6.n n 7.n b 8.9. 0.a. ",
" <.b.c.d. e.f.g.h.i. ",
" j.k.0. l.m.h.h.h.n. ",
" o.p.q. q.r.h.h.k. ",
" q.p.s. t.u.v.w. ",
" 0.k.x. y.v.i.z.s. ",
" A.B.C.D.E. C.B.F. ",
" G.u.h.H. q.I.J. ",
" K.F.F.F.F.F.F.F.F.F.F.F.L.M.h.h.p.F.F.N.O.P.F.F.F.l.Q. ",
" R.S.T.T.T.T.T.T.T.T.T.E.U.V.h.h.W.T.J.v.X.T.T.T.T.Y.Z.Q. ",
" R.S.P.`.`.`.`.`.`.`.`.`.T. +.+m.++@+s.`.`.`.`.`.`.P.Z.Q. ",
" R.S.P.`.`.`.`.`.`.`.`.`.`.`.#+`.Y.`.`.`.`.`.`.`.`.P.Z. ",
" R.$+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+&+ ",
" *+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ "};

View File

@@ -1,134 +0,0 @@
/* XPM */
static char * dynamicaCreateActiveSphereRBArray_xpm[] = {
"32 32 99 2",
" c #B1B1B1",
". c #B69C9C",
"+ c #B99292",
"@ c #BE7B7B",
"# c #D13232",
"$ c #D81515",
"% c #D51F1F",
"& c #D61B1B",
"* c #C46464",
"= c #BB8989",
"- c #D90F0F",
"; c #BD7F7F",
"> c #B89696",
", c #C56262",
"' c #CD4141",
") c #C17070",
"! c #B79898",
"~ c #DC0202",
"{ c #B2AFAF",
"] c #DB0808",
"^ c #B3A9A9",
"/ c #B5A2A2",
"( c #D71717",
"_ c #B79A9A",
": c #C85555",
"< c #C65C5C",
"[ c #BD8181",
"} c #D13030",
"| c #B69E9E",
"1 c #B4A5A5",
"2 c #C26E6E",
"3 c #DA0A0A",
"4 c #BF7979",
"5 c #DA0C0C",
"6 c #CC4343",
"7 c #BA8C8C",
"8 c #898989",
"9 c #969696",
"0 c #9C9C9C",
"a c #A7A7A7",
"b c #0F0F0F",
"c c #707070",
"d c #ABABAB",
"e c #737373",
"f c #2C2C2C",
"g c #000000",
"h c #8E8E8E",
"i c #7F7F7F",
"j c #080808",
"k c #6E6E6E",
"l c #0C0C0C",
"m c #A2A2A2",
"n c #4F4F4F",
"o c #212121",
"p c #ADADAD",
"q c #494949",
"r c #4B4B4B",
"s c #606060",
"t c #131313",
"u c #060606",
"v c #1D1D1D",
"w c #7D7D7D",
"x c #858585",
"y c #929292",
"z c #A0A0A0",
"A c #797979",
"B c #626262",
"C c #6C6C6C",
"D c #414141",
"E c #454545",
"F c #2A2A2A",
"G c #434343",
"H c #7C7C7C",
"I c #5A5A5A",
"J c #121212",
"K c #2F2F2F",
"L c #141414",
"M c #686868",
"N c #A9A9A9",
"O c #818181",
"P c #5C5C5C",
"Q c #646464",
"R c #2D2D2D",
"S c #050505",
"T c #151515",
"U c #575757",
"V c #636363",
"W c #555555",
"X c #6A6A6A",
"Y c #3C3C3C",
"Z c #111111",
"` c #666666",
" . c #090909",
".. c #515151",
"+. c #5B5B5B",
"@. c #5F5F5F",
"#. c #616161",
"$. c #A5A5A5",
"%. c #959595",
" ",
" . + . + ",
" @ # $ % & * @ # $ % & * ",
" = - ; > % , = - ; > % , ",
" ' ) ! ~ { ' ) ! ~ { ",
" ] ^ % + ] ^ % + ",
" - / ( _ - / ( _ ",
" : < [ } : < [ } ",
" | ~ : . 1 2 3 4 | ~ : . 1 2 3 4 ",
" 1 < $ 5 6 7 1 < $ 5 6 7 ",
" . + . + ",
" @ # $ % & * @ # $ % & * ",
" = - ; > % , = - ; > % , ",
" ' ) ! ~ { ' ) ! ~ { ",
" ] ^ % + ] ^ % + ",
" - / ( _ - / ( _ ",
" : < [ } : < [ } ",
" | ~ : . 1 2 3 4 | ~ : . 1 2 3 4 ",
" 1 < $ 5 6 7 8 1 < $ 5 6 7 9 0 ",
" a b c d e f g h ",
" i j 9 k l g g g m ",
" n o p p q g g j ",
" p o r s t u v ",
" 9 j w x u h y r ",
" c b z A B z b C ",
" D t g E p F G ",
" H C C C C C C C C C C C I J g g o C C K L M C C C k N ",
" O P Q Q Q Q Q Q Q Q Q B R S g g T Q G u U Q Q Q Q V W N ",
" O P M X X X X X X X X X Q Y Z l ` .r X X X X X X M W N ",
" O P M X X X X X X X X X X X ..X V X X X X X X X X M W ",
" O +.@.@.@.@.@.@.@.@.@.@.@.@.@.@.@.@.@.@.@.@.@.@.@.@.#. ",
" $.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%. "};

View File

@@ -1,213 +0,0 @@
/* XPM */
static char * dynamicaCreatePinConstraint_xpm[] = {
"32 32 178 2",
" c #B1B1B1",
". c #A8A8A8",
"+ c #A5A5A5",
"@ c #718172",
"# c #6D866F",
"$ c #999999",
"% c #9B9B9B",
"& c #7B9B7E",
"* c #77CF80",
"= c #69846C",
"- c #8F8F8F",
"; c #989898",
"> c #82A185",
", c #88EC91",
"' c #57DD63",
") c #529C59",
"! c #878787",
"~ c #A2A2A2",
"{ c #949494",
"] c #88AA8B",
"^ c #8EED97",
"/ c #58E465",
"( c #23DC34",
"_ c #30B33C",
": c #667A68",
"< c #959595",
"[ c #9E9E9E",
"} c #757C76",
"| c #9BD9A1",
"1 c #87EC90",
"2 c #4BE259",
"3 c #17DA29",
"4 c #04D718",
"5 c #13C624",
"6 c #528C57",
"7 c #8B8B8B",
"8 c #A9A9A9",
"9 c #A6A6A6",
"0 c #717371",
"a c #99CB9E",
"b c #9BEFA3",
"c c #6FE87A",
"d c #30DE40",
"e c #09D71C",
"f c #00D614",
"g c #33A73E",
"h c #8E8E8E",
"i c #93BB97",
"j c #A3F0AA",
"k c #82EB8C",
"l c #49E257",
"m c #15D927",
"n c #01D615",
"o c #28B235",
"p c #419B49",
"q c #508D56",
"r c #9F9F9F",
"s c #89A68C",
"t c #A6F1AD",
"u c #8DED96",
"v c #59E466",
"w c #21DB32",
"x c #24B532",
"y c #858585",
"z c #969696",
"A c #929292",
"B c #809281",
"C c #A7EBAD",
"D c #94EE9C",
"E c #67E773",
"F c #2DDD3D",
"G c #06D119",
"H c #5E8061",
"I c #A0A0A0",
"J c #919191",
"K c #8A8A8A",
"L c #778278",
"M c #A0E2A6",
"N c #99EFA1",
"O c #73E87E",
"P c #3BDF4A",
"Q c #10D923",
"R c #36A441",
"S c #BE0000",
"T c #A20000",
"U c #7C1D14",
"V c #88744E",
"W c #877D52",
"X c #8B8F5F",
"Y c #95CA89",
"Z c #77E982",
"` c #46E155",
" . c #03D617",
".. c #13C424",
"+. c #69766B",
"@. c #AAAAAA",
"#. c #747D74",
"$. c #94D79B",
"%. c #86EC8F",
"&. c #7EEA88",
"*. c #6DE878",
"=. c #47E155",
"-. c #1CDB2E",
";. c #4C9053",
">. c #75C27C",
",. c #7AEA84",
"'. c #74E97F",
"). c #68E774",
"!. c #5AE467",
"~. c #4CE25A",
"{. c #38DF48",
"]. c #1DDB2F",
"^. c #07D71A",
"/. c #23B631",
"(. c #848484",
"_. c #66896A",
":. c #49C955",
"<. c #35DF45",
"[. c #2BDD3C",
"}. c #22DB33",
"|. c #1ADA2C",
"1. c #11D924",
"2. c #09CE1C",
"3. c #5D8160",
"4. c #69786A",
"5. c #32B03E",
"6. c #02D616",
"7. c #2BAF37",
"8. c #898989",
"9. c #A4A4A4",
"0. c #7F7F7F",
"a. c #399141",
"b. c #06D019",
"c. c #24B631",
"d. c #A7A7A7",
"e. c #AFAFAF",
"f. c #BDBDBD",
"g. c #528156",
"h. c #12C223",
"i. c #14C424",
"j. c #6C746C",
"k. c #AEAEAE",
"l. c #EBEBEB",
"m. c #F4F4F4",
"n. c #C2C2C2",
"o. c #697A6A",
"p. c #26AE33",
"q. c #09CE1B",
"r. c #627D64",
"s. c #A3A3A3",
"t. c #C7C7C7",
"u. c #FCFCFC",
"v. c #E6E6E6",
"w. c #DFDFDF",
"x. c #409C48",
"y. c #04D217",
"z. c #6E726F",
"A. c #B0B0B0",
"B. c #F8F8F8",
"C. c #8D8D8D",
"D. c #528B57",
"E. c #1BA610",
"F. c #5B835F",
"G. c #DDDDDD",
"H. c #EAEAEA",
"I. c #880000",
"J. c #B5B5B5",
"K. c #DEDEDE",
"L. c #E9E9E9",
"M. c #A1A1A1",
"N. c #CACACA",
"O. c #DCDCDC",
"P. c #ACACAC",
"Q. c #D8D8D8",
"R. c #C6C6C6",
"S. c #ADADAD",
"T. c #BA0000",
"U. c #BB0000",
" ",
" . + ",
" . @ # $ ",
" % & * = - ",
" ; > , ' ) ! ~ ",
" { ] ^ / ( _ : < ",
" [ } | 1 2 3 4 5 6 7 8 ",
" 9 0 a b c d e f f f g h ",
" 7 i j k l m n f o p q r ",
" h s t u v w 4 f x y z r ",
" A B C D E F e f G H I ",
" 8 J - K L M N O P Q n f R h ",
" S S S S S S S S T U V W X Y D Z ` 3 .f ..+.@. ",
" S I #.$.N ^ %.&.*.=.-.4 f f ;.z ",
" S y >.,.'.).!.~.{.].^.f f /.(. ",
" S I _.:.<.[.}.|.1.^.n f 2.3.r ",
" S ; 4.5.^.4 4 6.n f f 7.8. ",
" S 9.0.a.b.f f f f f c.y ",
" S d.e.f.g.h.f f f f i.j.k. ",
" S e.; l.m.n.o.p.f f f q.r.8 ",
" S s.t.u.v.w.; (.x.y.f /.z.A. ",
" S @.~ B.v.w.9 9.A.C.D.E.F.r ",
" S r G.H.w.9.9. $ I.$ ",
" S + J.m.K.s.9. S ",
" S k.$ L.G.M.9. S ",
" S s.N.O.I + S ",
" S P.+ Q.r + S ",
" S ~ R.r 9 S ",
" S S.s.[ P. S ",
" S S S S T.U.S S S S S S S S S S S S ",
" ",
" "};

View File

@@ -1,213 +0,0 @@
/* XPM */
static char * dynamicaCreatePinConstraint_xpm[] = {
"32 32 178 2",
" c #B1B1B1",
". c #A8A8A8",
"+ c #A5A5A5",
"@ c #718172",
"# c #6D866F",
"$ c #999999",
"% c #9B9B9B",
"& c #7B9B7E",
"* c #77CF80",
"= c #69846C",
"- c #8F8F8F",
"; c #989898",
"> c #82A185",
", c #88EC91",
"' c #57DD63",
") c #529C59",
"! c #878787",
"~ c #A2A2A2",
"{ c #949494",
"] c #88AA8B",
"^ c #8EED97",
"/ c #58E465",
"( c #23DC34",
"_ c #30B33C",
": c #667A68",
"< c #959595",
"[ c #9E9E9E",
"} c #757C76",
"| c #9BD9A1",
"1 c #87EC90",
"2 c #4BE259",
"3 c #17DA29",
"4 c #04D718",
"5 c #13C624",
"6 c #528C57",
"7 c #8B8B8B",
"8 c #A9A9A9",
"9 c #A6A6A6",
"0 c #717371",
"a c #99CB9E",
"b c #9BEFA3",
"c c #6FE87A",
"d c #30DE40",
"e c #09D71C",
"f c #00D614",
"g c #33A73E",
"h c #8E8E8E",
"i c #93BB97",
"j c #A3F0AA",
"k c #82EB8C",
"l c #49E257",
"m c #15D927",
"n c #01D615",
"o c #28B235",
"p c #419B49",
"q c #508D56",
"r c #9F9F9F",
"s c #89A68C",
"t c #A6F1AD",
"u c #8DED96",
"v c #59E466",
"w c #21DB32",
"x c #24B532",
"y c #858585",
"z c #969696",
"A c #929292",
"B c #809281",
"C c #A7EBAD",
"D c #94EE9C",
"E c #67E773",
"F c #2DDD3D",
"G c #06D119",
"H c #5E8061",
"I c #A0A0A0",
"J c #919191",
"K c #8A8A8A",
"L c #778278",
"M c #A0E2A6",
"N c #99EFA1",
"O c #73E87E",
"P c #3BDF4A",
"Q c #10D923",
"R c #36A441",
"S c #BE0000",
"T c #A20000",
"U c #7C1D14",
"V c #88744E",
"W c #877D52",
"X c #8B8F5F",
"Y c #95CA89",
"Z c #77E982",
"` c #46E155",
" . c #03D617",
".. c #13C424",
"+. c #69766B",
"@. c #AAAAAA",
"#. c #747D74",
"$. c #94D79B",
"%. c #86EC8F",
"&. c #7EEA88",
"*. c #6DE878",
"=. c #47E155",
"-. c #1CDB2E",
";. c #4C9053",
">. c #75C27C",
",. c #7AEA84",
"'. c #74E97F",
"). c #68E774",
"!. c #5AE467",
"~. c #4CE25A",
"{. c #38DF48",
"]. c #1DDB2F",
"^. c #07D71A",
"/. c #23B631",
"(. c #848484",
"_. c #66896A",
":. c #49C955",
"<. c #35DF45",
"[. c #2BDD3C",
"}. c #22DB33",
"|. c #1ADA2C",
"1. c #11D924",
"2. c #09CE1C",
"3. c #5D8160",
"4. c #69786A",
"5. c #32B03E",
"6. c #02D616",
"7. c #2BAF37",
"8. c #898989",
"9. c #A4A4A4",
"0. c #7F7F7F",
"a. c #399141",
"b. c #06D019",
"c. c #24B631",
"d. c #A7A7A7",
"e. c #AFAFAF",
"f. c #BDBDBD",
"g. c #528156",
"h. c #12C223",
"i. c #14C424",
"j. c #6C746C",
"k. c #AEAEAE",
"l. c #EBEBEB",
"m. c #F4F4F4",
"n. c #C2C2C2",
"o. c #697A6A",
"p. c #26AE33",
"q. c #09CE1B",
"r. c #627D64",
"s. c #A3A3A3",
"t. c #C7C7C7",
"u. c #FCFCFC",
"v. c #E6E6E6",
"w. c #DFDFDF",
"x. c #409C48",
"y. c #04D217",
"z. c #6E726F",
"A. c #B0B0B0",
"B. c #F8F8F8",
"C. c #8D8D8D",
"D. c #528B57",
"E. c #1BA610",
"F. c #5B835F",
"G. c #DDDDDD",
"H. c #EAEAEA",
"I. c #880000",
"J. c #B5B5B5",
"K. c #DEDEDE",
"L. c #E9E9E9",
"M. c #A1A1A1",
"N. c #CACACA",
"O. c #DCDCDC",
"P. c #ACACAC",
"Q. c #D8D8D8",
"R. c #C6C6C6",
"S. c #ADADAD",
"T. c #BA0000",
"U. c #BB0000",
" ",
" . + ",
" . @ # $ ",
" % & * = - ",
" ; > , ' ) ! ~ ",
" { ] ^ / ( _ : < ",
" [ } | 1 2 3 4 5 6 7 8 ",
" 9 0 a b c d e f f f g h ",
" 7 i j k l m n f o p q r ",
" h s t u v w 4 f x y z r ",
" A B C D E F e f G H I ",
" 8 J - K L M N O P Q n f R h ",
" S S S S S S S S T U V W X Y D Z ` 3 .f ..+.@. ",
" S I #.$.N ^ %.&.*.=.-.4 f f ;.z ",
" S y >.,.'.).!.~.{.].^.f f /.(. ",
" S I _.:.<.[.}.|.1.^.n f 2.3.r ",
" S ; 4.5.^.4 4 6.n f f 7.8. ",
" S 9.0.a.b.f f f f f c.y ",
" S d.e.f.g.h.f f f f i.j.k. ",
" S e.; l.m.n.o.p.f f f q.r.8 ",
" S s.t.u.v.w.; (.x.y.f /.z.A. ",
" S @.~ B.v.w.9 9.A.C.D.E.F.r ",
" S r G.H.w.9.9. $ I.$ ",
" S + J.m.K.s.9. S ",
" S k.$ L.G.M.9. S ",
" S s.N.O.I + S ",
" S P.+ Q.r + S ",
" S ~ R.r 9 S ",
" S S.s.[ P. S ",
" S S S S T.U.S S S S S S S S S S S S ",
" ",
" "};

View File

@@ -1,213 +0,0 @@
/* XPM */
static char * dynamicaCreatePinConstraint_xpm[] = {
"32 32 178 2",
" c #B1B1B1",
". c #A8A8A8",
"+ c #A5A5A5",
"@ c #718172",
"# c #6D866F",
"$ c #999999",
"% c #9B9B9B",
"& c #7B9B7E",
"* c #77CF80",
"= c #69846C",
"- c #8F8F8F",
"; c #989898",
"> c #82A185",
", c #88EC91",
"' c #57DD63",
") c #529C59",
"! c #878787",
"~ c #A2A2A2",
"{ c #949494",
"] c #88AA8B",
"^ c #8EED97",
"/ c #58E465",
"( c #23DC34",
"_ c #30B33C",
": c #667A68",
"< c #959595",
"[ c #9E9E9E",
"} c #757C76",
"| c #9BD9A1",
"1 c #87EC90",
"2 c #4BE259",
"3 c #17DA29",
"4 c #04D718",
"5 c #13C624",
"6 c #528C57",
"7 c #8B8B8B",
"8 c #A9A9A9",
"9 c #A6A6A6",
"0 c #717371",
"a c #99CB9E",
"b c #9BEFA3",
"c c #6FE87A",
"d c #30DE40",
"e c #09D71C",
"f c #00D614",
"g c #33A73E",
"h c #8E8E8E",
"i c #93BB97",
"j c #A3F0AA",
"k c #82EB8C",
"l c #49E257",
"m c #15D927",
"n c #01D615",
"o c #28B235",
"p c #419B49",
"q c #508D56",
"r c #9F9F9F",
"s c #89A68C",
"t c #A6F1AD",
"u c #8DED96",
"v c #59E466",
"w c #21DB32",
"x c #24B532",
"y c #858585",
"z c #969696",
"A c #929292",
"B c #809281",
"C c #A7EBAD",
"D c #94EE9C",
"E c #67E773",
"F c #2DDD3D",
"G c #06D119",
"H c #5E8061",
"I c #A0A0A0",
"J c #919191",
"K c #8A8A8A",
"L c #778278",
"M c #A0E2A6",
"N c #99EFA1",
"O c #73E87E",
"P c #3BDF4A",
"Q c #10D923",
"R c #36A441",
"S c #BE0000",
"T c #A20000",
"U c #7C1D14",
"V c #88744E",
"W c #877D52",
"X c #8B8F5F",
"Y c #95CA89",
"Z c #77E982",
"` c #46E155",
" . c #03D617",
".. c #13C424",
"+. c #69766B",
"@. c #AAAAAA",
"#. c #747D74",
"$. c #94D79B",
"%. c #86EC8F",
"&. c #7EEA88",
"*. c #6DE878",
"=. c #47E155",
"-. c #1CDB2E",
";. c #4C9053",
">. c #75C27C",
",. c #7AEA84",
"'. c #74E97F",
"). c #68E774",
"!. c #5AE467",
"~. c #4CE25A",
"{. c #38DF48",
"]. c #1DDB2F",
"^. c #07D71A",
"/. c #23B631",
"(. c #848484",
"_. c #66896A",
":. c #49C955",
"<. c #35DF45",
"[. c #2BDD3C",
"}. c #22DB33",
"|. c #1ADA2C",
"1. c #11D924",
"2. c #09CE1C",
"3. c #5D8160",
"4. c #69786A",
"5. c #32B03E",
"6. c #02D616",
"7. c #2BAF37",
"8. c #898989",
"9. c #A4A4A4",
"0. c #7F7F7F",
"a. c #399141",
"b. c #06D019",
"c. c #24B631",
"d. c #A7A7A7",
"e. c #AFAFAF",
"f. c #BDBDBD",
"g. c #528156",
"h. c #12C223",
"i. c #14C424",
"j. c #6C746C",
"k. c #AEAEAE",
"l. c #EBEBEB",
"m. c #F4F4F4",
"n. c #C2C2C2",
"o. c #697A6A",
"p. c #26AE33",
"q. c #09CE1B",
"r. c #627D64",
"s. c #A3A3A3",
"t. c #C7C7C7",
"u. c #FCFCFC",
"v. c #E6E6E6",
"w. c #DFDFDF",
"x. c #409C48",
"y. c #04D217",
"z. c #6E726F",
"A. c #B0B0B0",
"B. c #F8F8F8",
"C. c #8D8D8D",
"D. c #528B57",
"E. c #1BA610",
"F. c #5B835F",
"G. c #DDDDDD",
"H. c #EAEAEA",
"I. c #880000",
"J. c #B5B5B5",
"K. c #DEDEDE",
"L. c #E9E9E9",
"M. c #A1A1A1",
"N. c #CACACA",
"O. c #DCDCDC",
"P. c #ACACAC",
"Q. c #D8D8D8",
"R. c #C6C6C6",
"S. c #ADADAD",
"T. c #BA0000",
"U. c #BB0000",
" ",
" . + ",
" . @ # $ ",
" % & * = - ",
" ; > , ' ) ! ~ ",
" { ] ^ / ( _ : < ",
" [ } | 1 2 3 4 5 6 7 8 ",
" 9 0 a b c d e f f f g h ",
" 7 i j k l m n f o p q r ",
" h s t u v w 4 f x y z r ",
" A B C D E F e f G H I ",
" 8 J - K L M N O P Q n f R h ",
" S S S S S S S S T U V W X Y D Z ` 3 .f ..+.@. ",
" S I #.$.N ^ %.&.*.=.-.4 f f ;.z ",
" S y >.,.'.).!.~.{.].^.f f /.(. ",
" S I _.:.<.[.}.|.1.^.n f 2.3.r ",
" S ; 4.5.^.4 4 6.n f f 7.8. ",
" S 9.0.a.b.f f f f f c.y ",
" S d.e.f.g.h.f f f f i.j.k. ",
" S e.; l.m.n.o.p.f f f q.r.8 ",
" S s.t.u.v.w.; (.x.y.f /.z.A. ",
" S @.~ B.v.w.9 9.A.C.D.E.F.r ",
" S r G.H.w.9.9. $ I.$ ",
" S + J.m.K.s.9. S ",
" S k.$ L.G.M.9. S ",
" S s.N.O.I + S ",
" S P.+ Q.r + S ",
" S ~ R.r 9 S ",
" S S.s.[ P. S ",
" S S S S T.U.S S S S S S S S S S S S ",
" ",
" "};

View File

@@ -1,112 +0,0 @@
/* XPM */
static char * dynamicaCreatePassiveBoxRB_xpm[] = {
"32 32 77 1",
" c #B1B1B1",
". c #B0B0B0",
"+ c #979797",
"@ c #808080",
"# c #949494",
"$ c #595959",
"% c #7A7A7A",
"& c #747474",
"* c #939393",
"= c #575757",
"- c #7B7B7B",
"; c #888888",
"> c #A2A2A2",
", c #848484",
"' c #5F5F5F",
") c #323232",
"! c #313131",
"~ c #373737",
"{ c #444444",
"] c #9E9E9E",
"^ c #656565",
"/ c #3D3D3D",
"( c #343434",
"_ c #454545",
": c #4C4C4C",
"< c #303030",
"[ c #2B2B2B",
"} c #202020",
"| c #2C2C2C",
"1 c #4A4A4A",
"2 c #8A8A8A",
"3 c #8C8C8C",
"4 c #ADADAD",
"5 c #434343",
"6 c #262626",
"7 c #797979",
"8 c #4D4D4D",
"9 c #868686",
"0 c #565656",
"a c #101010",
"b c #000000",
"c c #505050",
"d c #020202",
"e c #0E0E0E",
"f c #828282",
"g c #AFAFAF",
"h c #555555",
"i c #161616",
"j c #989898",
"k c #515151",
"l c #0C0C0C",
"m c #686868",
"n c #585858",
"o c #090909",
"p c #060606",
"q c #636363",
"r c #2E2E2E",
"s c #181818",
"t c #909090",
"u c #535353",
"v c #171717",
"w c #6B6B6B",
"x c #919191",
"y c #5E5E5E",
"z c #424242",
"A c #6E6E6E",
"B c #858585",
"C c #4F4F4F",
"D c #080808",
"E c #414141",
"F c #242424",
"G c #1A1A1A",
"H c #3F3F3F",
"I c #9C9C9C",
"J c #666666",
"K c #A5A5A5",
"L c #878787",
" ",
" ",
" ",
" ",
" ",
" . ",
" +@@@@@@@@@@@@@@# ",
" +$%&&&&&&&&&&&&&* ",
" +=$-&&&&&&&&&&&&&* ",
" +==$-&&&&&&&&&&&&&* ",
" +===$;;;;;;;;;;;;;;. ",
" +====;;;;;;;;;;;;;; ",
" +====;;;;;;;;;;;;;; ",
" >,')!~{@;;;;;;;;;;;;; ",
" ]^/(_:<![}|1-;;;;;;;;;;; ",
" 2=34 +====&56789;;;;;;;; ",
" +====;;0abc;;;;;;;; ",
" +====;;0dbef;;;;;;; 4-g",
" +====;;hibb5;;;;;;; jklm ",
" ]n===;;;;cop%;;;;;qrbbsg ",
" tn==;;;;;uvk;;;;;webb@ ",
" xn=;;;;;;y[zAB;&CDdE ",
" xn;;;;;;;-1FvGFHIJK ",
" x;;;;;;;;;;;,L; ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "};

View File

@@ -1,100 +0,0 @@
/* XPM */
static char * dynamicaCreatePassiveBoxRBArray_xpm[] = {
"32 32 65 1",
" c #B1B1B1",
". c #4E4E4E",
"+ c #A2A2A2",
"@ c #848484",
"# c #707070",
"$ c #666666",
"% c #2C2C2C",
"& c #8B8B8B",
"* c #A7A7A7",
"= c #9E9E9E",
"- c #656565",
"; c #3D3D3D",
"> c #343434",
", c #454545",
"' c #595959",
") c #626262",
"! c #575757",
"~ c #414141",
"{ c #3A3A3A",
"] c #606060",
"^ c #A0A0A0",
"/ c #8A8A8A",
"( c #8C8C8C",
"_ c #ADADAD",
": c #424242",
"< c #262626",
"[ c #161616",
"} c #646464",
"| c #4D4D4D",
"1 c #141414",
"2 c #000000",
"3 c #686868",
"4 c #323232",
"5 c #010101",
"6 c #080808",
"7 c #4A4A4A",
"8 c #7B7B7B",
"9 c #AFAFAF",
"0 c #6E6E6E",
"a c #0D0D0D",
"b c #989898",
"c c #515151",
"d c #0C0C0C",
"e c #676767",
"f c #050505",
"g c #818181",
"h c #2E2E2E",
"i c #181818",
"j c #2F2F2F",
"k c #1D1D1D",
"l c #696969",
"m c #0E0E0E",
"n c #808080",
"o c #383838",
"p c #555555",
"q c #909090",
"r c #979797",
"s c #020202",
"t c #1F1F1F",
"u c #0F0F0F",
"v c #525252",
"w c #9C9C9C",
"x c #A5A5A5",
"y c #4C4C4C",
"z c #B0B0B0",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ....... ....... ",
" . . . . ",
" . . . . ",
" . . . . ",
" +@#$%#&* . . . ",
" =-;>,')%!~{]^. . . ",
" /!(_ ...:<[,}|...... ",
" #123 ",
" .....45267..... _89",
" . 0a22! . bcd3 ",
" . .ef6= . gh22i9 ",
" . . jkl . (m22n ",
" . . .8opq_.re6s~ ",
" . . . ^]jtujvw$x ",
" ....... ......yz ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "};

View File

@@ -1,159 +0,0 @@
/* XPM */
static char * dynamicaCreatePassiveHullRB_xpm[] = {
"32 32 124 2",
" c #B1B1B1",
". c #9D9D9D",
"+ c #989898",
"@ c #A4A4A4",
"# c #ABABAB",
"$ c #838383",
"% c #565656",
"& c #5D5D5D",
"* c #575757",
"= c #525252",
"- c #636363",
"; c #6E6E6E",
"> c #797979",
", c #8B8B8B",
"' c #979797",
") c #A2A2A2",
"! c #A9A9A9",
"~ c #7C7C7C",
"{ c #5A5A5A",
"] c #747474",
"^ c #727272",
"/ c #B3B3B3",
"( c #919191",
"_ c #8C8C8C",
": c #939393",
"< c #888888",
"[ c #787878",
"} c #696969",
"| c #5E5E5E",
"1 c #626262",
"2 c #6D6D6D",
"3 c #8F8F8F",
"4 c #959595",
"5 c #ACACAC",
"6 c #A7A7A7",
"7 c #7A7A7A",
"8 c #595959",
"9 c #ADADAD",
"0 c #828282",
"a c #AFAFAF",
"b c #C2C2C2",
"c c #858585",
"d c #8E8E8E",
"e c #A8A8A8",
"f c #9F9F9F",
"g c #949494",
"h c #606060",
"i c #A5A5A5",
"j c #808080",
"k c #818181",
"l c #BBBBBB",
"m c #AAAAAA",
"n c #8D8D8D",
"o c #C0C0C0",
"p c #5F5F5F",
"q c #848484",
"r c #9B9B9B",
"s c #9C9C9C",
"t c #B0B0B0",
"u c #BCBCBC",
"v c #868686",
"w c #5C5C5C",
"x c #767676",
"y c #969696",
"z c #B6B6B6",
"A c #C1C1C1",
"B c #B5B5B5",
"C c #7F7F7F",
"D c #707070",
"E c #7B7B7B",
"F c #B7B7B7",
"G c #8A8A8A",
"H c #9E9E9E",
"I c #444444",
"J c #1F1F1F",
"K c #383838",
"L c #2E2E2E",
"M c #414141",
"N c #6B6B6B",
"O c #484848",
"P c #3F3F3F",
"Q c #6A6A6A",
"R c #999999",
"S c #646464",
"T c #7E7E7E",
"U c #4F4F4F",
"V c #4A4A4A",
"W c #373737",
"X c #545454",
"Y c #161616",
"Z c #000000",
"` c #6C6C6C",
" . c #7D7D7D",
".. c #BFBFBF",
"+. c #030303",
"@. c #151515",
"#. c #B9B9B9",
"$. c #BDBDBD",
"%. c #585858",
"&. c #A3A3A3",
"*. c #202020",
"=. c #B4B4B4",
"-. c #515151",
";. c #0C0C0C",
">. c #686868",
",. c #717171",
"'. c #080808",
"). c #BABABA",
"!. c #A0A0A0",
"~. c #181818",
"{. c #737373",
"]. c #0E0E0E",
"^. c #676767",
"/. c #323232",
"(. c #363636",
"_. c #474747",
":. c #020202",
"<. c #666666",
"[. c #909090",
"}. c #5B5B5B",
"|. c #555555",
"1. c #292929",
"2. c #212121",
"3. c #2F2F2F",
" ",
" ",
" ",
" ",
" ",
" ",
" . + @ ",
" # $ % & * = - ; > , ' ) ",
" ! ~ { ] ^ ! / ( _ : < [ } | = 1 2 [ , 3 4 5 ",
" 6 7 8 7 6 9 0 a b , 0 $ c < d e f g 7 h | * & 5 ",
" i [ { j @ ( k [ < a b l a 9 m e f n f ~ / o p ; 5 ",
" a & q r 4 > s t u b b b b b b b b b v r c # b k w 5 ",
" @ { x < y z b b b b b b b b b b b b t k # 7 A B | d ",
" ( | e C } D ; E + F b b b b b b b b b G n r b _ { a ",
" H I J K L M N ; p O P Q a b b b b b b b / R A b S T ",
" G U V + 0 : b b b b i p W 9 ; o b b b b b b b m X 5 ",
" 7 1 t a b b b b b b E Y Z ^ b b b b b b b Q ` ",
" t { ...b b b b b b E +.Z @.#.b b b b $.E %.i 9 E a ",
" $ Q &.b b b b b b > *.Z Z h b b b =.; 8 ) + -.;.>. ",
" e * < b b b b b b b b ,.;.'.9 b ).D %.!.k L Z Z ~.a ",
" ^ D R b b b b b b b b x *.{.).{.* H _ ].Z Z j ",
" f ^.{ {. b b b b b b b j /.(._.R ' ^.'.:.M ",
" s <.% x + [.G C ^ ^.}.|.L 1.J 2.3.= s <.i ",
" s } = | 1 N ] 0 g H a 5 t ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "};

View File

@@ -1,125 +0,0 @@
/* XPM */
static char * dynamicaCreatePassiveHullRBArray_xpm[] = {
"32 32 90 1",
" c #B1B1B1",
". c #ADADAD",
"+ c #878787",
"@ c #707070",
"# c #797979",
"$ c #838383",
"% c #909090",
"& c #9C9C9C",
"* c #A6A6A6",
"= c #ABABAB",
"- c #6D6D6D",
"; c #818181",
"> c #A0A0A0",
", c #858585",
"' c #787878",
") c #737373",
"! c #747474",
"~ c #777777",
"{ c #7D7D7D",
"] c #979797",
"^ c #6E6E6E",
"/ c #848484",
"( c #A8A8A8",
"_ c #ACACAC",
": c #989898",
"< c #646464",
"[ c #727272",
"} c #9D9D9D",
"| c #8E8E8E",
"1 c #9E9E9E",
"2 c #959595",
"3 c #7B7B7B",
"4 c #808080",
"5 c #828282",
"6 c #AFAFAF",
"7 c #9B9B9B",
"8 c #666666",
"9 c #656565",
"0 c #8B8B8B",
"a c #A7A7A7",
"b c #8D8D8D",
"c c #717171",
"d c #2F2F2F",
"e c #232323",
"f c #424242",
"g c #595959",
"h c #626262",
"i c #575757",
"j c #414141",
"k c #2E2E2E",
"l c #3C3C3C",
"m c #8A8A8A",
"n c #919191",
"o c #888888",
"p c #7F7F7F",
"q c #5F5F5F",
"r c #535353",
"s c #323232",
"t c #545454",
"u c #7A7A7A",
"v c #141414",
"w c #000000",
"x c #A9A9A9",
"y c #020202",
"z c #0F0F0F",
"A c #484848",
"B c #AAAAAA",
"C c #515151",
"D c #0C0C0C",
"E c #686868",
"F c #3B3B3B",
"G c #0B0B0B",
"H c #080808",
"I c #181818",
"J c #6C6C6C",
"K c #1D1D1D",
"L c #696969",
"M c #8C8C8C",
"N c #0E0E0E",
"O c #383838",
"P c #555555",
"Q c #676767",
"R c #606060",
"S c #1F1F1F",
"T c #212121",
"U c #525252",
"V c #A5A5A5",
"W c #B0B0B0",
"X c #898989",
"Y c #AEAEAE",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" .+@#$%&*= ",
" =+-;>&%,')!~{ ",
" ]^/( _:< ",
" [} /| .+@#$%&*= ",
" @1 =^==+-;>&%,')!~{ ",
" 23 45]^/( _:< ",
" 6@7/@89@0abc.[} /| ",
" 19defgh<ijkl7 @1 =^= ",
" mim5-5nop)qrs1tu 45 ",
" @vwfx bc. ",
" .+@#$%&*-ywz[x |^_ .36",
" =+-;>&%,')Avwwf-5nop)@B:CDE ",
" ]^/( _:FGH1 ;kwwI6 ",
" [} /|JKL MNww4 ",
" @1 =^= 3OP%. ]QHyj ",
" 23 45 >RdSTdU&8V ",
" 6@x bc. _W ",
" X'x |^_ ",
" Y,-5nop)@B ",
" ",
" ",
" ",
" ",
" ",
" "};

View File

@@ -1,152 +0,0 @@
/* XPM */
static char * dynamicaCreatePassiveMeshRB_xpm[] = {
"32 32 117 2",
" c #B1B1B1",
". c #A5A5A5",
"+ c #929292",
"@ c #8C8C8C",
"# c #9F9F9F",
"$ c #AEAEAE",
"% c #858585",
"& c #9B9B9B",
"* c #9E9E9E",
"= c #8E8E8E",
"- c #A0A0A0",
"; c #AAAAAA",
"> c #A6A6A6",
", c #ADADAD",
"' c #8F8F8F",
") c #919191",
"! c #979797",
"~ c #838383",
"{ c #868686",
"] c #848484",
"^ c #ACACAC",
"/ c #999999",
"( c #8D8D8D",
"_ c #949494",
": c #969696",
"< c #A3A3A3",
"[ c #AFAFAF",
"} c #9C9C9C",
"| c #A1A1A1",
"1 c #A7A7A7",
"2 c #A9A9A9",
"3 c #959595",
"4 c #888888",
"5 c #909090",
"6 c #9D9D9D",
"7 c #9A9A9A",
"8 c #8B8B8B",
"9 c #A8A8A8",
"0 c #727272",
"a c #616161",
"b c #606060",
"c c #5E5E5E",
"d c #696969",
"e c #7F7F7F",
"f c #989898",
"g c #878787",
"h c #898989",
"i c #7B7B7B",
"j c #565656",
"k c #313131",
"l c #2D2D2D",
"m c #343434",
"n c #444444",
"o c #595959",
"p c #5B5B5B",
"q c #4E4E4E",
"r c #3A3A3A",
"s c #515151",
"t c #7A7A7A",
"u c #6C6C6C",
"v c #7C7C7C",
"w c #8A8A8A",
"x c #6B6B6B",
"y c #464646",
"z c #282828",
"A c #828282",
"B c #B0B0B0",
"C c #585858",
"D c #101010",
"E c #000000",
"F c #808080",
"G c #787878",
"H c #6F6F6F",
"I c #636363",
"J c #505050",
"K c #4C4C4C",
"L c #545454",
"M c #020202",
"N c #0D0D0D",
"O c #656565",
"P c #4B4B4B",
"Q c #6D6D6D",
"R c #797979",
"S c #767676",
"T c #757575",
"U c #494949",
"V c #131313",
"W c #4F4F4F",
"X c #555555",
"Y c #0C0C0C",
"Z c #686868",
"` c #6A6A6A",
" . c #676767",
".. c #646464",
"+. c #626262",
"@. c #050505",
"#. c #030303",
"$. c #434343",
"%. c #818181",
"&. c #2E2E2E",
"*. c #181818",
"=. c #777777",
"-. c #5D5D5D",
";. c #525252",
">. c #2C2C2C",
",. c #0E0E0E",
"'. c #393939",
"). c #202020",
"!. c #3D3D3D",
"~. c #7E7E7E",
"{. c #080808",
"]. c #414141",
"^. c #6E6E6E",
"/. c #666666",
"(. c #2F2F2F",
"_. c #1F1F1F",
":. c #212121",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" . + @ # ",
" $ % & * = - ; > , ",
" $ = # . @ = ' ) + ! ; * ~ { { ] , ",
" ^ / ( % ( # . # / ! _ + = : < { + ' % ~ $ ",
" [ . } { ! | 1 2 > < | # } / ! 3 4 | ) + 5 ] ! $ ",
" 6 ] @ _ < 2 2 1 . | # } & 7 ! 3 _ ) = , % 5 % 8 ",
" 9 4 ' 0 a b c d e : & f ! : 3 _ + + + g : h ~ i & ",
" * j k l m n o p q r k s ] ) 5 5 ' = = @ 4 ~ t u v 1 ",
" w s x ) g @ & 7 f 3 i y z v q 4 4 % A i 0 d b c A B ",
" : g @ ( ) ) 5 ' @ w C D E q F G H I C J K 0 6 ",
" # ~ { { g 4 g % ] L M E N u O C P P q Q : , i [ ",
" 3 e i t R G S T U V E E l W P P X v / f s Y Z ",
" < e 0 Q ` ...+.a c m @.#.$.P J v * %.&.E E *.[ ",
" : =.+.-.C L ;.W P P &.Y >.s R 7 @ ,.E E F ",
" , : G -.q P P P P P P '.).!.~., ! .{.M ]. ",
" * F ^./.I I /.u T e h -.(._.:.(.;.} /.. ",
" $ - / ! ! / * > $ ^ B ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "};

View File

@@ -1,128 +0,0 @@
/* XPM */
static char * dynamicaCreatePassiveMeshRBArray_xpm[] = {
"32 32 93 2",
" c #B1B1B1",
". c #898989",
"+ c #616161",
"@ c #ACACAC",
"# c #AEAEAE",
"$ c #A3A3A3",
"% c #A7A7A7",
"& c #8A8A8A",
"* c #525252",
"= c #656565",
"- c #565656",
"; c #515151",
"> c #8E8E8E",
", c #545454",
"' c #9C9C9C",
") c #868686",
"! c #535353",
"~ c #5A5A5A",
"{ c #606060",
"] c #686868",
"^ c #676767",
"/ c #646464",
"( c #909090",
"_ c #585858",
": c #636363",
"< c #A0A0A0",
"[ c #989898",
"} c #555555",
"| c #5B5B5B",
"1 c #696969",
"2 c #626262",
"3 c #707070",
"4 c #595959",
"5 c #666666",
"6 c #A8A8A8",
"7 c #5D5D5D",
"8 c #808080",
"9 c #979797",
"0 c #575757",
"a c #505050",
"b c #AFAFAF",
"c c #5F5F5F",
"d c #787878",
"e c #A2A2A2",
"f c #848484",
"g c #2D2D2D",
"h c #393939",
"i c #4C4C4C",
"j c #7B7B7B",
"k c #B0B0B0",
"l c #9E9E9E",
"m c #3D3D3D",
"n c #343434",
"o c #454545",
"p c #444444",
"q c #282828",
"r c #222222",
"s c #3C3C3C",
"t c #717171",
"u c #9D9D9D",
"v c #8C8C8C",
"w c #ADADAD",
"x c #323232",
"y c #878787",
"z c #303030",
"A c #0D0D0D",
"B c #000000",
"C c #020202",
"D c #090909",
"E c #6E6E6E",
"F c #171717",
"G c #4D4D4D",
"H c #0C0C0C",
"I c #3A3A3A",
"J c #030303",
"K c #040404",
"L c #5E5E5E",
"M c #424242",
"N c #1F1F1F",
"O c #181818",
"P c #4B4B4B",
"Q c #353535",
"R c #0E0E0E",
"S c #2C2C2C",
"T c #6B6B6B",
"U c #7D7D7D",
"V c #080808",
"W c #414141",
"X c #2F2F2F",
"Y c #212121",
"Z c #A5A5A5",
"` c #8B8B8B",
" . c #6D6D6D",
" ",
" ",
" ",
" ",
" ",
" . + . @ # $ $ ",
" % & * = - ; ; & > , , $ ",
" ' ) ! ~ { ] ^ = / - ( _ : , < ",
" [ } | = 1 1 1 1 1 1 2 ; : ~ & ",
" 3 + 4 5 1 1 1 1 1 1 ] 2 ^ * 6 ",
" [ } { ] 1 1 1 1 1 1 1 1 7 8 ",
" 9 0 1 1 1 1 1 1 1 1 ~ a 6 ",
" b a c 1 1 1 1 1 ] ~ d . + . @ # $ $ ",
" e f 3 | g h i 7 + 7 } j k % & * = - ; ; & > , , $ ",
" l = m n o 4 2 / p q r s t u ' ) ! ~ { ] ^ = / - ( _ : , < ",
" & 0 v w 9 0 x y z ~ = 1 1 1 1 1 1 2 ; : ~ & ",
" 3 A B n 5 1 1 1 1 1 1 ] 2 ^ * 6 ",
" . + . @ # 3 C B D : 1 1 1 1 1 1 1 1 7 8 w j b ",
" % & * = - ; ; & E F B B z 1 1 1 1 1 1 1 ~ o G H ] ",
" ' ) ! ~ { ] ^ = / - ( _ I J K L 1 1 1 1 ] M N B B O b ",
" [ } | = 1 1 1 1 1 1 2 ; : ~ P A Q + : + 7 } + R B B 8 ",
" 3 + 4 5 1 1 1 1 1 1 ] 2 ^ * 6 j S Q } T U ) ^ V C W ",
" [ } { ] 1 1 1 1 1 1 1 1 7 8 < { X N Y X * ' 5 Z ",
" 9 0 1 1 1 1 1 1 1 1 ~ a 6 @ k ",
" b a c 1 1 1 1 1 ] ~ d ",
" u a ~ + : + 7 } j k ",
" ` .1 E U u ",
" ",
" ",
" ",
" ",
" "};

View File

@@ -1,108 +0,0 @@
/* XPM */
static char * dynamicaCreatePassivePlaneRB_xpm[] = {
"32 32 73 1",
" c #B1B1B1",
". c #A2A2A2",
"+ c #848484",
"@ c #707070",
"# c #666666",
"$ c #656565",
"% c #8B8B8B",
"& c #A7A7A7",
"* c #9E9E9E",
"= c #3D3D3D",
"- c #343434",
"; c #454545",
"> c #595959",
", c #626262",
"' c #646464",
") c #575757",
"! c #414141",
"~ c #3A3A3A",
"{ c #606060",
"] c #A0A0A0",
"^ c #8A8A8A",
"/ c #8C8C8C",
"( c #ADADAD",
"_ c #979797",
": c #323232",
"< c #AFAFAF",
"[ c #7C7C7C",
"} c #6C6C6C",
"| c #0C0C0C",
"1 c #000000",
"2 c #404040",
"3 c #6E6E6E",
"4 c #A9A9A9",
"5 c #818181",
"6 c #5C5C5C",
"7 c #010101",
"8 c #0B0B0B",
"9 c #5F5F5F",
"0 c #636363",
"a c #555555",
"b c #7B7B7B",
"c c #686868",
"d c #6A6A6A",
"e c #424242",
"f c #111111",
"g c #272727",
"h c #3E3E3E",
"i c #070707",
"j c #050505",
"k c #4D4D4D",
"l c #1B1B1B",
"m c #5B5B5B",
"n c #0F0F0F",
"o c #383838",
"p c #4B4B4B",
"q c #616161",
"r c #A5A5A5",
"s c #959595",
"t c #676767",
"u c #2F2F2F",
"v c #484848",
"w c #797979",
"x c #919191",
"y c #7F7F7F",
"z c #565656",
"A c #020202",
"B c #363636",
"C c #1F1F1F",
"D c #212121",
"E c #525252",
"F c #9C9C9C",
"G c #ACACAC",
"H c #B0B0B0",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" .+@#$@%& ",
" *$=-;>,')!~{] ",
" ^)/( _):*'< ",
" [}}}}}}}}}}}};|12}}}}}}}}34 ",
" 56'''''''''''27189'''''''0a4(b<",
" 56cdddddddddef11-dddddddd>g|c ",
" 56cddddddddddhij9dddddkl11|< ",
" 5m99999999999~no99999pi11;q ",
" rsssssssssssstuvwxsyziABs ",
" ]{uCDuEF#r ",
" GH ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "};

View File

@@ -1,117 +0,0 @@
/* XPM */
static char * dynamicaCreatePassivePlaneRBArray_xpm[] = {
"32 32 82 1",
" c #B1B1B1",
". c #6E6E6E",
"+ c #5F5F5F",
"@ c #616161",
"# c #606060",
"$ c #666666",
"% c #7E7E7E",
"& c #626262",
"* c #6D6D6D",
"= c #636363",
"- c #A9A9A9",
"; c #4E4E4E",
"> c #767676",
", c #777777",
"' c #5B5B5B",
") c #787878",
"! c #757575",
"~ c #5E5E5E",
"{ c #747474",
"] c #505050",
"^ c #4D4D4D",
"/ c #5C5C5C",
"( c #5D5D5D",
"_ c #4F4F4F",
": c #ADADAD",
"< c #868686",
"[ c #6F6F6F",
"} c #565656",
"| c #555555",
"1 c #8C8C8C",
"2 c #959595",
"3 c #929292",
"4 c #9E9E9E",
"5 c #656565",
"6 c #3D3D3D",
"7 c #343434",
"8 c #454545",
"9 c #595959",
"0 c #646464",
"a c #575757",
"b c #414141",
"c c #3A3A3A",
"d c #3C3C3C",
"e c #8A8A8A",
"f c #979797",
"g c #303030",
"h c #1B1B1B",
"i c #3E3E3E",
"j c #6C6C6C",
"k c #323232",
"l c #0E0E0E",
"m c #000000",
"n c #464646",
"o c #4A4A4A",
"p c #010101",
"q c #0D0D0D",
"r c #717171",
"s c #7B7B7B",
"t c #AFAFAF",
"u c #2D2D2D",
"v c #2B2B2B",
"w c #060606",
"x c #090909",
"y c #858585",
"z c #272727",
"A c #181818",
"B c #151515",
"C c #696969",
"D c #808080",
"E c #383838",
"F c #909090",
"G c #676767",
"H c #080808",
"I c #020202",
"J c #2F2F2F",
"K c #1F1F1F",
"L c #212121",
"M c #525252",
"N c #9C9C9C",
"O c #A5A5A5",
"P c #ACACAC",
"Q c #B0B0B0",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" .+@@@@@@@@@@@#$% ",
" &@************@= ",
" -;>,,,,,,,,,,,,') ",
" !~,,,,,,,,,,,,{] ",
" ^/'''''''''''(_: ",
" <[~}|+!122223: ",
" 456789&0abcd}@@@@@@@@@@@#$% ",
" ea1: fgh@ij*********@= ",
" -klmn,,,,,,,,,,') ",
" opmqr,,,,,,,,,{;st",
" .qmmu'''''''';vw$ ",
" |xwy22222*zmmAt ",
" .+@@@@@@@@@@@#iBC 1lmmD ",
" &@************@8E|F: fGHIb ",
" -;>,,,,,,,,,,,,'j#JKLJMN$O ",
" !~,,,,,,,,,,,,{] PQ ",
" ^/'''''''''''(_: ",
" 3222222222223: ",
" ",
" ",
" ",
" ",
" ",
" "};

View File

@@ -1,37 +0,0 @@
/* XPM */
static char * dynamicaCreatePassiveRB_xpm[] = {
"32 32 2 1",
" c None",
". c #E0AE36",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................"};

View File

@@ -1,177 +0,0 @@
/* XPM */
static char * dynamicaCreatePassiveSphereRB_xpm[] = {
"32 32 142 2",
" c #B1B1B1",
". c #ADADAD",
"+ c #ABABAB",
"@ c #AEAEAE",
"# c #A8A8A8",
"$ c #A5A5A5",
"% c #B2B2B2",
"& c #B6B6B6",
"* c #B5B5B5",
"= c #A4A4A4",
"- c #AAAAAA",
"; c #B0B0B0",
"> c #A9A9A9",
", c #C3C3C3",
"' c #D4D4D4",
") c #D5D5D5",
"! c #D3D3D3",
"~ c #D2D2D2",
"{ c #D0D0D0",
"] c #CDCDCD",
"^ c #C7C7C7",
"/ c #D6D6D6",
"( c #CFCFCF",
"_ c #CBCBCB",
": c #C2C2C2",
"< c #BABABA",
"[ c #A7A7A7",
"} c #B9B9B9",
"| c #D1D1D1",
"1 c #CECECE",
"2 c #CACACA",
"3 c #C5C5C5",
"4 c #BFBFBF",
"5 c #B8B8B8",
"6 c #C8C8C8",
"7 c #BBBBBB",
"8 c #A0A0A0",
"9 c #A2A2A2",
"0 c #C6C6C6",
"a c #BEBEBE",
"b c #9F9F9F",
"c c #939393",
"d c #929292",
"e c #ACACAC",
"f c #B3B3B3",
"g c #C1C1C1",
"h c #838383",
"i c #767676",
"j c #9D9D9D",
"k c #AFAFAF",
"l c #7C7C7C",
"m c #797979",
"n c #777777",
"o c #848484",
"p c #A3A3A3",
"q c #C4C4C4",
"r c #CCCCCC",
"s c #A1A1A1",
"t c #919191",
"u c #808080",
"v c #727272",
"w c #6B6B6B",
"x c #8A8A8A",
"y c #9E9E9E",
"z c #656565",
"A c #3D3D3D",
"B c #343434",
"C c #414141",
"D c #626262",
"E c #707070",
"F c #737373",
"G c #646464",
"H c #4B4B4B",
"I c #424242",
"J c #6E6E6E",
"K c #BCBCBC",
"L c #8E8E8E",
"M c #7A7A7A",
"N c #666666",
"O c #5E5E5E",
"P c #575757",
"Q c #8C8C8C",
"R c #5F5F5F",
"S c #363636",
"T c #8D8D8D",
"U c #606060",
"V c #4F4F4F",
"W c #676767",
"X c #747474",
"Y c #141414",
"Z c #000000",
"` c #696969",
" . c #5C5C5C",
".. c #505050",
"+. c #4E4E4E",
"@. c #6A6A6A",
"#. c #020202",
"$. c #0F0F0F",
"%. c #6F6F6F",
"&. c #565656",
"*. c #717171",
"=. c #7B7B7B",
"-. c #A6A6A6",
";. c #9B9B9B",
">. c #979797",
",. c #151515",
"'. c #2E2E2E",
"). c #858585",
"!. c #989898",
"~. c #515151",
"{. c #0C0C0C",
"]. c #686868",
"^. c #909090",
"/. c #898989",
"(. c #828282",
"_. c #383838",
":. c #050505",
"<. c #030303",
"[. c #464646",
"}. c #525252",
"|. c #181818",
"1. c #7E7E7E",
"2. c #535353",
"3. c #2F2F2F",
"4. c #0D0D0D",
"5. c #0E0E0E",
"6. c #545454",
"7. c #191919",
"8. c #262626",
"9. c #3F3F3F",
"0. c #4C4C4C",
"a. c #888888",
"b. c #080808",
"c. c #959595",
"d. c #595959",
"e. c #2B2B2B",
"f. c #101010",
"g. c #1D1D1D",
"h. c #9C9C9C",
"i. c #969696",
"j. c #818181",
"k. c #636363",
" ",
" ",
" ",
" ",
" ",
" . + + + @ ",
" @ # $ % & & * . = - ; ",
" > > , ' ) ! ~ { ] ^ * = - ",
" ; > & ) / / ) ! ~ ( _ ^ : < [ > ",
" > } / / / / ' ! | 1 2 3 4 5 $ - ",
" + ; ! ' ) / ) ' ~ { ] 6 : 7 % > 8 9 @ ",
" = _ ! ! ' ' ' ! | 1 _ 0 a * + b c d # ",
" e f | | ~ ! ! ~ | 1 _ ^ g 5 . 8 d h i j k ",
" 9 l m n i o p q ( r 6 0 : < @ s t u v w x + ",
" y z A B C D E F G H I J f g K 5 @ b L M J N O n # ",
" x P Q . p q 3 0 0 0 # R S = z + 8 T i w U P V W [ ",
" = K a a a a K < X Y Z U t n ` ...+.+.` [ ",
" $ % f % ; @ e @.#.Z $.%.z &.+.+.+.+.*.> . =.k ",
" > # -.9 y ;.>.d &.,.Z Z '.+.+.+.+.+.+.).e !.~.{.]. ",
" . 9 !.^./.(.M F J W _.:.<.[.+.+.+.+.}.X '.Z Z |.k ",
" [ ^.1.X %.@.G .2.+.3.4.3.+.+.+.+.m ).5.Z Z u ",
" e j X @.G .6.+.+.+.+.S 7.8.9.0.O a.N b.#.C ",
" - c.z d...+.+.+.+.+.+.[.e.Y f.g.'.}.h.N $ ",
" > i.O +.+.+.+.+.+.+.+.+.W j -.; ",
" + 9 j.k.+.+.+.+.~.].T [ . ",
" + -.8 d d c p [ . ",
" @ @ @ ",
" ",
" ",
" ",
" ",
" "};

View File

@@ -1,122 +0,0 @@
/* XPM */
static char * dynamicaCreatePassiveSphereRBArray_xpm[] = {
"32 32 87 1",
" c #B1B1B1",
". c #A6A6A6",
"+ c #A0A0A0",
"@ c #949494",
"# c #6D6D6D",
"$ c #5D5D5D",
"% c #636363",
"& c #616161",
"* c #888888",
"= c #9C9C9C",
"- c #5A5A5A",
"; c #969696",
"> c #A2A2A2",
", c #878787",
"' c #757575",
") c #8E8E8E",
"! c #A4A4A4",
"~ c #535353",
"{ c #B0B0B0",
"] c #565656",
"^ c #ADADAD",
"/ c #A9A9A9",
"( c #5E5E5E",
"_ c #A5A5A5",
": c #848484",
"< c #606060",
"[ c #5C5C5C",
"} c #656565",
"| c #707070",
"1 c #8B8B8B",
"2 c #A7A7A7",
"3 c #979797",
"4 c #6C6C6C",
"5 c #808080",
"6 c #838383",
"7 c #9E9E9E",
"8 c #3D3D3D",
"9 c #343434",
"0 c #454545",
"a c #585858",
"b c #525252",
"c c #5B5B5B",
"d c #424242",
"e c #434343",
"f c #AAAAAA",
"g c #8D8D8D",
"h c #939393",
"i c #8A8A8A",
"j c #575757",
"k c #8C8C8C",
"l c #595959",
"m c #323232",
"n c #646464",
"o c #AFAFAF",
"p c #767676",
"q c #9D9D9D",
"r c #141414",
"s c #000000",
"t c #686868",
"u c #020202",
"v c #131313",
"w c #7B7B7B",
"x c #545454",
"y c #1D1D1D",
"z c #2C2C2C",
"A c #989898",
"B c #515151",
"C c #0C0C0C",
"D c #676767",
"E c #121212",
"F c #060606",
"G c #2E2E2E",
"H c #181818",
"I c #1F1F1F",
"J c #696969",
"K c #7E7E7E",
"L c #0E0E0E",
"M c #787878",
"N c #383838",
"O c #555555",
"P c #909090",
"Q c #080808",
"R c #414141",
"S c #2F2F2F",
"T c #494949",
"U c #666666",
"V c #929292",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" .+ .+ ",
" @#$%&* @#$%&* ",
" =-; >%, =-; >%, ",
" ') !~{ ') !~{ ",
" ]^ %+ ]^ %+ ",
" -/ (_ -/ (_ ",
" >:<[}|1234 56 34 ",
" 7}890abc]de~, 2~5.fgah ",
" ijk^ f6$l4]m7nof6$lpq ",
" .+ |rst .+ ",
" @#$%&*|usvg#$%&* ^wo",
" =-; >%xyssz; >%, ABCt ",
" ') !~{DEF7 !~5GssHo ",
" ]^ %+ ~IJ %KLss5 ",
" -/ (_ -MNOP^ cnQuR ",
" 56 34 56+<SIGTb=U_ ",
" 2~5.fgah 2~5.fgjV ",
" f6$lpq f6$lpq ",
" ",
" ",
" ",
" ",
" ",
" ",
" "};

Some files were not shown because too many files have changed in this diff Show More