本文整理汇总了C++中dAssert函数的典型用法代码示例。如果您正苦于以下问题:C++ dAssert函数的具体用法?C++ dAssert怎么用?C++ dAssert使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dAssert函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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]);
}
示例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;
}
示例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;
}
示例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();
}
}
示例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;
}
示例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;
}
示例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");
}
示例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();
}
示例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();
}
示例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();
}
示例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;
}
示例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);
}
示例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);
}
}
示例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));
}
}
示例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();
}