本文整理汇总了C++中dAssert函数的典型用法代码示例。如果您正苦于以下问题:C++ dAssert函数的具体用法?C++ dAssert怎么用?C++ dAssert使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dAssert函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: dAssert
NewtonCollision* dCollisionConeNodeInfo::CreateNewtonCollision (NewtonWorld* const world, dScene* const scene, dScene::dTreeNode* const myNode) const
{
dAssert (IsType (dCollisionConeNodeInfo::GetRttiType()));
// get the collision node
int collisionID = GetShapeId ();
const dMatrix& offsetMatrix = GetTransform ();
// create a newton collision shape from the node.
return NewtonCreateCone(world, m_radius, m_height, collisionID, &offsetMatrix[0][0]);
}
开发者ID:Shaderd00d,项目名称:newton-dynamics,代码行数:11,代码来源:dCollisionConeNodeInfo.cpp
示例2: RayPrefilter
static unsigned RayPrefilter (const NewtonBody* const body, const NewtonCollision* const collision, void* const userData)
{
// if the collision has a parent, the this can be it si a sub shape of a compound collision
const NewtonCollision* const parent = NewtonCollisionGetParentInstance(collision);
if (parent) {
// you can use this to filter sub collision shapes.
dAssert (NewtonCollisionGetSubCollisionHandle (collision));
}
return 1;
}
开发者ID:Kaoswerk,项目名称:newton-dynamics,代码行数:11,代码来源:PhysicsUtils.cpp
示例3: dAssert
dScriptCompiler::dUserVariable dScriptCompiler::FunctionAddParameterNode (const dUserVariable& parameter)
{
dUserVariable returnNode;
dDAGParameterNode* const parameterNode = (dDAGParameterNode*)parameter.m_node;
dAssert (parameterNode->GetTypeId() == dDAGParameterNode::GetRttiType());
dDAGFunctionNode* const function = GetCurrentClass()->GetCurrentFunction();
function->AddParameter(parameterNode);
return returnNode;
}
开发者ID:famorcia,项目名称:newton-dynamics,代码行数:11,代码来源:dLittleScriptCompiler.cpp
示例4: dAssert
dDAGFunctionStatementCase::dDAGFunctionStatementCase(dList<dDAG*>& allNodes, const char* const nameID, dDAGFunctionStatement* const childStatement)
:dDAGFunctionStatement(allNodes)
,m_nameId(nameID)
,m_statementList()
{
for (dDAGFunctionStatement* node = childStatement; node; node = (dDAGFunctionStatement*) node->m_next) {
m_statementList.Append(node);
dAssert (0);
// node->AddRef();
}
}
开发者ID:Kaoswerk,项目名称:newton-dynamics,代码行数:11,代码来源:dDAGFunctionStatementCASE.cpp
示例5: dAssert
bool dCILInstrMove::ApplyCopyPropagation (dCILInstrMove* const moveInst)
{
bool ret = false;
if (moveInst->m_arg0.m_label == m_arg1.m_label) {
ret = true;
m_arg1.m_label = moveInst->m_arg1.m_label;
}
dAssert(ret);
return ret;
}
开发者ID:kmammou,项目名称:newton-dynamics,代码行数:11,代码来源:dCILInstrLoadStore.cpp
示例6: Find
dListNode* Find (dCRCTYPE nameCRC) const
{
for (dListNode* node = GetFirst(); node; node = node->GetNext()) {
if (node->GetInfo().m_nameCRC == nameCRC) {
return node;
}
}
dAssert (0);
return NULL;
}
开发者ID:famorcia,项目名称:newton-dynamics,代码行数:11,代码来源:dParserCompiler.cpp
示例7: sprintf
void dCILInstrPhy::Serialize(char* const textOut) const
{
sprintf(textOut, "\t%s %s = phi (", m_arg0.GetTypeName().GetStr(), m_arg0.m_label.GetStr());
for (dList<dArgPair>::dListNode* node = m_sources.GetFirst(); node; node = node->GetNext()) {
char tmp[1024];
dArgPair& pair = node->GetInfo();
dArg* const arg = pair.m_intructionNode ? pair.m_intructionNode->GetInfo()->GetGeneratedVariable() : &pair.m_arg;
dAssert (arg);
dCILInstrLabel* const block = pair.m_block->m_begin->GetInfo()->GetAsLabel();
dAssert(block);
if (node->GetNext()) {
sprintf(tmp, "[%s %s, %s], ", arg->GetTypeName().GetStr(), arg->m_label.GetStr(), block->GetArg0().m_label.GetStr());
} else {
sprintf(tmp, "[%s %s, %s]", arg->GetTypeName().GetStr(), arg->m_label.GetStr(), block->GetArg0().m_label.GetStr());
}
strcat(textOut, tmp);
}
strcat(textOut, ")\n");
}
开发者ID:kmammou,项目名称:newton-dynamics,代码行数:20,代码来源:dCILInstrLoadStore.cpp
示例8: dAssert
void dMeshNodeInfo::DrawWireFrame(dSceneRender* const render, dScene* const scene, dScene::dTreeNode* const myNode) const
{
dAssert (myNode == scene->Find(GetUniqueID()));
dAssert (scene->GetInfoFromNode(myNode) == this);
int displayList = render->GetCachedWireframeDisplayList(m_mesh);
dAssert (displayList > 0);
render->PushMatrix(&m_matrix[0][0]);
if (GetEditorFlags() & m_selected) {
dVector color (render->GetColor());
render->SetColor(dVector (1.0f, 1.0f, 0.0f, 0.0f));
render->DrawDisplayList(displayList);
render->SetColor(color);
} else {
render->DrawDisplayList(displayList);
}
render->PopMatrix();
}
开发者ID:Shaderd00d,项目名称:newton-dynamics,代码行数:20,代码来源:dMeshNodeInfo.cpp
示例9: while
void dBasicBlocksGraph::CalculateSuccessorsAndPredecessors ()
{
m_mark += 1;
dList<dBasicBlock*> stack;
stack.Append(&GetFirst()->GetInfo());
while (stack.GetCount()) {
dBasicBlock* const block = stack.GetLast()->GetInfo();
stack.Remove(stack.GetLast()->GetInfo());
if (block->m_mark < m_mark) {
block->m_mark = m_mark;
//m_traversalBlocksOrder.Addtop(block);
//block->Trace();
dCILInstr* const instruction = block->m_end->GetInfo();
dAssert(instruction->IsBasicBlockEnd());
if (instruction->GetAsIF()) {
dCILInstrConditional* const ifInstr = instruction->GetAsIF();
dAssert (ifInstr->GetTrueTarget());
dAssert (ifInstr->GetFalseTarget());
dCILInstrLabel* const target0 = ifInstr->GetTrueTarget()->GetInfo()->GetAsLabel();
dCILInstrLabel* const target1 = ifInstr->GetFalseTarget()->GetInfo()->GetAsLabel();
dBasicBlock* const block0 = target0->m_basicBlock;
dAssert (block0);
block->m_successors.Append (block0);
block0->m_predecessors.Append(block);
stack.Append (block0);
dBasicBlock* const block1 = target1->m_basicBlock;
dAssert(block1);
block->m_successors.Append(block1);
block1->m_predecessors.Append(block);
stack.Append(block1);
} else if (instruction->GetAsGoto()) {
dCILInstrGoto* const gotoInst = instruction->GetAsGoto();
dAssert(gotoInst->GetTarget());
dCILInstrLabel* const target = gotoInst->GetTarget()->GetInfo()->GetAsLabel();
dBasicBlock* const block0 = target->m_basicBlock;
dAssert(block0);
block->m_successors.Append(block0);
block0->m_predecessors.Append(block);
stack.Append(block0);
}
}
}
DeleteUnreachedBlocks();
}
开发者ID:iokto,项目名称:newton-dynamics,代码行数:56,代码来源:dBasicBlocksGraph.cpp
示例10: dAssert
dNewtonLuaCompiler::dUserVariable dNewtonLuaCompiler::EmitAssigmentStatement(const dUserVariable& nameList, const dUserVariable& expresionList)
{
//dList<dCIL::dListNode*>::dListNode* nameListNode = nameList.m_nodeList.GetFirst();
dList<dString>::dListNode* nameListNode = nameList.m_tokenList.GetFirst();
dList<dCIL::dListNode*>::dListNode* expressionListNode = expresionList.m_nodeList.GetFirst();
dAssert(nameList.m_tokenList.GetCount() >= 1);
dAssert(expresionList.m_nodeList.GetCount() >= 1);
int count = dMin (nameList.m_tokenList.GetCount(), expresionList.m_nodeList.GetCount());
for (int i = 0; i < count; i ++) {
//dCILSingleArgInstr* const dst = nameListNode->GetInfo();
const dString& dstName = nameListNode->GetInfo();
/*
if (dest->GetAsLocal()) {
dCILInstrLocal* const dstIntruction = dest->GetAsLocal();
const dCILInstr::dArg& argName = dstIntruction->GetArg0();
for (dList<dCILInstrLocal*>::dListNode* node = m_currentClosure->m_localVariables.GetFirst(); node; node = node->GetNext()) {
dCILInstrLocal* const intruction = node->GetInfo()->GetAsLocal();
dAssert(intruction);
if (argName.m_label == intruction->GetArg0().m_label) {
destArg = argName;
break;
}
}
}
*/
dCILSingleArgInstr* const src = expressionListNode->GetInfo()->GetInfo()->GetAsSingleArg();
dAssert(src);
//dAssert(dst);
//const dCILInstr::dArg& dstArg = dst->GetArg0();
const dCILInstr::dArg& srcArg = src->GetArg0();
dCILInstrMove* const move = new dCILInstrMove(*m_currentClosure, dstName, srcArg.GetType(), srcArg.m_label, srcArg.GetType());
TRACE_INSTRUCTION(move);
nameListNode = nameListNode->GetNext();
expressionListNode = expressionListNode->GetNext();
}
return dUserVariable();
}
开发者ID:Shaderd00d,项目名称:newton-dynamics,代码行数:41,代码来源:dNewtonLuaCompiler.cpp
示例11: variableName
dScriptCompiler::dUserVariable dScriptCompiler::NewVariableToCurrentBlock (const dString& modifiers, const dUserVariable& type, const dString& name)
{
dUserVariable variableName(NewVariableStatement (name, modifiers));
dDAGParameterNode* const variableNameNode = (dDAGParameterNode*)variableName.m_node;
dAssert (variableNameNode->IsType(dDAGParameterNode::GetRttiType()));
dDAGTypeNode* const typeNode = (dDAGTypeNode*)type.m_node;
dAssert (typeNode->GetTypeId() == dDAGTypeNode::GetRttiType());
variableNameNode->SetType(typeNode);
dAssert (m_scopeStack.GetCount());
dDAGScopeBlockNode* const block = GetCurrentScope();
block->AddStatement(variableNameNode);
dUserVariable returnNode (NewExpressionNodeVariable (name, modifiers));
dAssert (returnNode.m_node->GetTypeId() == dDAGExpressionNodeVariable::GetRttiType());
dDAGExpressionNodeVariable* const node = (dDAGExpressionNodeVariable*) returnNode.m_node;
node->SetType((dDAGTypeNode*) typeNode->Clone (m_allNodes));
return returnNode;
}
开发者ID:famorcia,项目名称:newton-dynamics,代码行数:21,代码来源:dLittleScriptCompiler.cpp
示例12: CreateSimpleSolid
NewtonBody* CreateSimpleSolid (DemoEntityManager* const scene, DemoMesh* const mesh, dFloat mass, const dMatrix& matrix, NewtonCollision* const collision, int materialId, bool generalInertia)
{
dAssert (collision);
// add an new entity to the world
DemoEntity* const entity = new DemoEntity(matrix, NULL);
scene->Append (entity);
if (mesh) {
entity->SetMesh(mesh, dGetIdentityMatrix());
}
return CreateSimpleBody (scene->GetNewton(), entity, mass, matrix, collision, materialId, generalInertia);
}
开发者ID:MADEAPPS,项目名称:newton-dynamics,代码行数:12,代码来源:PhysicsUtils.cpp
示例13: dAssert
void dCILInstrReturn::AddUsedVariable (dInstructionVariableDictionary& dictionary) const
{
dAssert (!m_arg0.GetType().m_isPointer);
switch (m_arg0.GetType().m_intrinsicType)
{
case m_int:
{
dInstructionVariableDictionary::dTreeNode* const node = dictionary.Insert(m_arg0.m_label);
node->GetInfo().Append(m_myNode);
break;
}
case m_void:
case m_constInt:
break;
default:
dAssert(0);
}
}
开发者ID:famorcia,项目名称:newton-dynamics,代码行数:21,代码来源:dCILInstrBranch.cpp
示例14: dAssert
dDAGTypeNode::dDAGTypeNode(dList<dDAG*>& allNodes, const dDAGTypeNode& copySource)
:dDAG(allNodes)
,m_dimensions(copySource.m_dimensions)
,m_type (copySource.m_type)
{
m_name = copySource.m_name;
for (dList<dDAGDimensionNode*>::dListNode* node = copySource.m_dimensions.GetFirst(); node; node = node->GetNext()) {
dAssert (m_type.m_isPointer);
dDAGDimensionNode* const dim = node->GetInfo();
m_dimensions.Append ((dDAGDimensionNode*)dim->Clone(allNodes));
}
}
开发者ID:Kaoswerk,项目名称:newton-dynamics,代码行数:12,代码来源:dDAGTypeNode.cpp
示例15: dAssert
DemoBezierCurve::DemoBezierCurve(const dScene* const scene, dScene::dTreeNode* const bezierNode)
:DemoMeshInterface()
,m_curve()
,m_renderResolution(50)
{
m_isVisible = false;
dLineNodeInfo* const bezeriInfo = (dLineNodeInfo*)scene->GetInfoFromNode(bezierNode);
dAssert (bezeriInfo->IsType(dLineNodeInfo::GetRttiType()));
m_name = bezeriInfo->GetName();
m_curve = bezeriInfo->GetCurve();
}
开发者ID:Hurleyworks,项目名称:newton-dynamics,代码行数:12,代码来源:DemoMesh.cpp
示例16: dAssert
// draw scene in solid wire frame mode
void dRigidbodyNodeInfo::DrawSolidWireFrame(dScene* const world, dScene::dTreeNode* const myNode, const dVector& color) const
{
dAssert (world->GetInfoFromNode(myNode) == this);
dAssert (myNode == world->Find(GetUniqueID()));
dAssert (0);
/*
dScene::dTreeNode* geomNode = world->FindChildByType(myNode, dGeometryNodeInfo::GetRttiType());
if (geomNode) {
glPushMatrix();
dMatrix matrix (GetTransform());
//glMultMatrix(&matrix[0][0]);
glLoadMatrix(&matrix[0][0]);
dGeometryNodeInfo* gemInfo = (dGeometryNodeInfo*) world->GetInfoFromNode(geomNode);
gemInfo->DrawSolidWireFrame(world, geomNode, color, workBuffer, worlfBufferInBytes);
glPopMatrix();
}
*/
}
开发者ID:Hurleyworks,项目名称:newton-dynamics,代码行数:22,代码来源:dRigidbodyNodeInfo.cpp
示例17: dAssert
void dDAGFunctionNode::EmitLLVMGoto (dLLVMSymbols& localSymbols, dCIL::dListNode* const stmtNode, llvm::BasicBlock* const llvmBlock, llvm::LLVMContext &context)
{
dAssert (0);
/*
const dThreeAdressStmt& stmt = stmtNode->GetInfo();
dAssert (stmt.m_operator == dThreeAdressStmt::m_nothing);
llvm::BasicBlock* const targetBlock = m_blockMap.Find (stmt.m_trueTargetJump);
dAssert (targetBlock);
llvm::BranchInst::Create (targetBlock, llvmBlock);
*/
}
开发者ID:famorcia,项目名称:newton-dynamics,代码行数:12,代码来源:dDAGFunctionNode.cpp
示例18: dFloat
void dComplentaritySolver::dBodyState::IntegrateVelocity (dFloat timestep)
{
const dFloat D_MAX_ANGLE_STEP = dFloat (45.0f * 3.141592f / 180.0f);
const dFloat D_ANGULAR_TOL = dFloat (0.0125f * 3.141592f / 180.0f);
m_globalCentreOfMass += m_veloc.Scale (timestep);
while (((m_omega % m_omega) * timestep * timestep) > (D_MAX_ANGLE_STEP * D_MAX_ANGLE_STEP)) {
m_omega = m_omega.Scale (dFloat (0.8f));
}
// this is correct
dFloat omegaMag2 = m_omega % m_omega;
if (omegaMag2 > (D_ANGULAR_TOL * D_ANGULAR_TOL)) {
dFloat invOmegaMag = 1.0f / dSqrt (omegaMag2);
dVector omegaAxis (m_omega.Scale (invOmegaMag));
dFloat omegaAngle = invOmegaMag * omegaMag2 * timestep;
dQuaternion rotation (omegaAxis, omegaAngle);
dQuaternion rotMatrix (m_matrix);
rotMatrix = rotMatrix * rotation;
rotMatrix.Scale( 1.0f / dSqrt (rotMatrix.DotProduct (rotMatrix)));
m_matrix = dMatrix (rotMatrix, m_matrix.m_posit);
}
m_matrix.m_posit = m_globalCentreOfMass - m_matrix.RotateVector(m_localFrame.m_posit);
#ifdef _DEBUG
int j0 = 1;
int j1 = 2;
for (int i = 0; i < 3; i ++) {
dAssert (m_matrix[i][3] == 0.0f);
dFloat val = m_matrix[i] % m_matrix[i];
dAssert (dAbs (val - 1.0f) < 1.0e-5f);
dVector tmp (m_matrix[j0] * m_matrix[j1]);
val = tmp % m_matrix[i];
dAssert (dAbs (val - 1.0f) < 1.0e-5f);
j0 = j1;
j1 = i;
}
#endif
}
开发者ID:Hurleyworks,项目名称:MiniNewton,代码行数:40,代码来源:dLinearAlgebra.cpp
示例19: memset
int dComplentaritySolver::dFrictionLessContactJoint::ReduceContacts (int count, dContact* const contacts, dFloat tol)
{
int mask[D_MAX_PLACEMENT_CONTACTS];
int index = 0;
int packContacts = 0;
dFloat window = tol;
dFloat window2 = window * window;
memset (mask, 0, size_t (count));
dSort (contacts, count, CompareContact, NULL);
dAssert (count <= D_MAX_PLACEMENT_CONTACTS);
for (int i = 0; i < count; i ++) {
if (!mask[i]) {
dFloat val = contacts[i].m_point[index] + window;
for (int j = i + 1; (j < count) && (contacts[j].m_point[index] < val) ; j ++) {
if (!mask[j]) {
dVector dp (contacts[j].m_point - contacts[i].m_point);
dFloat dist2 = dp % dp;
if (dist2 < window2) {
mask[j] = 1;
packContacts = 1;
}
}
}
}
}
if (packContacts) {
int j = 0;
for (int i = 0; i < count; i ++) {
dAssert (i < D_MAX_PLACEMENT_CONTACTS);
if (!mask[i]) {
contacts[j] = contacts[i];
j ++;
}
}
count = j;
}
return count;
}
开发者ID:Hurleyworks,项目名称:MiniNewton,代码行数:39,代码来源:dLinearAlgebra.cpp
示例20: NewtonCollisionAggregateAddBody
CustomArticulatedTransformController::dSkeletonBone* CustomArticulatedTransformController::AddBone (NewtonBody* const bone, const dMatrix& bindMatrix, dSkeletonBone* const parentBone)
{
m_bones[m_boneCount].m_body = bone;
m_bones[m_boneCount].m_myController = this;
m_bones[m_boneCount].m_parent = parentBone;
m_bones[m_boneCount].m_bindMatrix = bindMatrix;
NewtonCollisionAggregateAddBody (m_collisionAggregate, bone);
m_boneCount ++;
dAssert (m_boneCount < D_HIERACHICAL_CONTROLLER_MAX_BONES);
return &m_bones[m_boneCount - 1];
}
开发者ID:alexsaen,项目名称:newton-dynamics,代码行数:13,代码来源:CustomArcticulatedTransformManager.cpp
注:本文中的dAssert函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论