当前位置: 首页>>代码示例>>C++>>正文


C++ btVector3::getX方法代码示例

本文整理汇总了C++中btVector3::getX方法的典型用法代码示例。如果您正苦于以下问题:C++ btVector3::getX方法的具体用法?C++ btVector3::getX怎么用?C++ btVector3::getX使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在btVector3的用法示例。


在下文中一共展示了btVector3::getX方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: drawTriangle

    void PhysicsDebugDraw::drawTriangle(const btVector3& a,const btVector3& b,const btVector3& c,const btVector3& color,btScalar alpha)
    {
		debugRenderer->drawTriangle(
			Vec3(a.getX(), a.getY(), a.getZ()),
			Vec3(b.getX(), b.getY(), b.getZ()),
			Vec3(c.getX(), c.getY(), c.getZ()),
			Vec4(color.getX(), color.getY(), color.getZ(), alpha)
		);
    }
开发者ID:Fuatnow,项目名称:Pyros3D,代码行数:9,代码来源:PhysicsDebugDraw.cpp

示例2: drawLine

    void PhysicsDebugDraw::drawLine(const btVector3& from,const btVector3& to,const btVector3& fromColor, const btVector3& toColor)
    {
		debugRenderer->drawLine(
			Vec3(from.getX(), from.getY(), from.getZ()),
			Vec3(to.getX(), to.getY(), to.getZ()),
			Vec4(fromColor.getX(), fromColor.getY(), fromColor.getZ(), 1.f),
			Vec4(toColor.getX(), toColor.getY(), toColor.getZ(), 1.f)
		);
    }
开发者ID:Fuatnow,项目名称:Pyros3D,代码行数:9,代码来源:PhysicsDebugDraw.cpp

示例3:

/// conservative test for overlap between two aabbs
static bool TestAabbAgainstAabb2(const btVector3 &aabbMin1, const btVector3 &aabbMax1,
								const btVector3 &aabbMin2, const btVector3 &aabbMax2)
{
	bool overlap = true;
	overlap = (aabbMin1.getX() > aabbMax2.getX() || aabbMax1.getX() < aabbMin2.getX()) ? false : overlap;
	overlap = (aabbMin1.getZ() > aabbMax2.getZ() || aabbMax1.getZ() < aabbMin2.getZ()) ? false : overlap;
	overlap = (aabbMin1.getY() > aabbMax2.getY() || aabbMax1.getY() < aabbMin2.getY()) ? false : overlap;
	return overlap;
}
开发者ID:saggita,项目名称:experiments,代码行数:10,代码来源:btGpuSapBroadphase.cpp

示例4: drawLine

void DebugDrawer::drawLine(const btVector3 &from, const btVector3 &to,
                           const btVector3 &color) {

  glBegin(GL_LINES);
  glColor3f(color.getX(), color.getY(), color.getZ());
  glVertex3f(from.getX(), from.getY(), from.getZ());
  glVertex3f(to.getX(), to.getY(), to.getZ());
  glEnd();
}
开发者ID:jebacpogotowietylkobukmozemnieleczyc,项目名称:grafiksendwizualizejszyn,代码行数:9,代码来源:debugdrawer.cpp

示例5: drawLine

void NEGLDebugDrawer::drawLine(const btVector3& from, const btVector3& to, const btVector3& fromColor) {

    glBegin(GL_LINES);
    glColor3f(1.0f, 0.04f, 0.0f);
    glVertex3d(from.getX(), from.getY(), from.getZ());
    glColor3f(1.0f, 0.04f, 0.0f);
    glVertex3d(to.getX(), to.getY(), to.getZ());
    glEnd();
}
开发者ID:alexandrustaetu,项目名称:natural_editor,代码行数:9,代码来源:debug.cpp

示例6: createMeshFromSoftBody

IMesh* MeshTools::createMeshFromSoftBody(btSoftBody* softBody)
{
	SMeshBuffer* buffer = new SMeshBuffer();
	video::S3DVertex vtx;
	vtx.Color.set(255,255,255,255);

    /* Each soft body contain an array of vertices (nodes/particles_mass)   */
    btSoftBody::tNodeArray&   nodes(softBody->m_nodes);

    // Convert bullet nodes to vertices
    for(int i=0;i<nodes.size();++i)
    {
        const btSoftBody::Node&	n=nodes[i];
        const btVector3 normal=n.m_n;
        const btVector3 pos=n.m_x;

        vtx.Pos.set(pos.getX(), pos.getY(), pos.getZ());
		vtx.Normal.set(normal.getX(), normal.getY(), normal.getZ());

        // TODO: calculate texture coords
        //vtx.TCoords.set(tsx, tsy);

        buffer->Vertices.push_back(vtx);
    }

    // Convert triangles of the softbody to an index list
    for(int i=0;i<softBody->m_faces.size();++i)
    {
        auto	faces = softBody->m_faces;

        btSoftBody::Node*   node_0=faces[i].m_n[0];
        btSoftBody::Node*   node_1=faces[i].m_n[1];
        btSoftBody::Node*   node_2=faces[i].m_n[2];

        const int indices[] =
        {
            int(node_0-&nodes[0]),
            int(node_1-&nodes[0]),
            int(node_2-&nodes[0])
        };

        for(int j=0;j<3;++j)
            buffer->Indices.push_back(indices[j]);
    }

	buffer->recalculateBoundingBox();

	// Default the mesh to stream because most likely we will be updating
	// the vertex positions every frame to deal with softbody movement.
	buffer->setHardwareMappingHint(EHM_STREAM);

	SMesh* mesh = new SMesh();
	mesh->addMeshBuffer(buffer);
	mesh->recalculateBoundingBox();
	buffer->drop();
	return mesh;
}
开发者ID:Habaut,项目名称:GameBindings,代码行数:57,代码来源:MeshTools.cpp

示例7: drawLine

void BulletGLDebugDraw::drawLine(const btVector3& from,const btVector3& to,const btVector3& fromColor, const btVector3& toColor)
{
	glBegin(GL_LINES);
		glColor3f(fromColor.getX(), fromColor.getY(), fromColor.getZ());
		glVertex3d(from.getX(), from.getY(), from.getZ());
		glColor3f(toColor.getX(), toColor.getY(), toColor.getZ());
		glVertex3d(to.getX(), to.getY(), to.getZ());
	glEnd();
}
开发者ID:alemariusnexus,项目名称:gtatools,代码行数:9,代码来源:BulletGLDebugDraw.cpp

示例8: drawLine

void BulletDebugger::drawLine(const btVector3 & from, const btVector3 & to, const btVector3 & fromColor, const btVector3 & toColor) {
	points->push_back(from.getX());
	points->push_back(from.getY());
	points->push_back(from.getZ());
	points->push_back(1.0f);
	points->push_back(to.getX());
	points->push_back(to.getY());
	points->push_back(to.getZ());
	points->push_back(1.0f);
}
开发者ID:david-leal,项目名称:nau,代码行数:10,代码来源:bulletDebugger.cpp

示例9:

void	proPhysDebug::drawLine(const btVector3& from,const btVector3& to,const btVector3& color)
{
	peUint r = (peUint)color.getX()*255;
	peUint g = (peUint)color.getY()*255;
	peUint b = (peUint)color.getZ()*255;
	peUint uColor = (b<<16) + (g<<8) + (r) + (0xFF<<24);
	proVec3f lineFrom = Vec3f(from.getX(), from.getY(), from.getZ());
	proVec3f lineTo = Vec3f(to.getX(), to.getY(), to.getZ());
	proRenderDebug::Instance()->DrawLine3D(lineFrom, lineTo, uColor);
}
开发者ID:productive,项目名称:gitservoir,代码行数:10,代码来源:proPhysDebug.cpp

示例10:

void	GLDebugDrawer::drawLine(const btVector3& from,const btVector3& to,const btVector3& fromColor, const btVector3& toColor)
{
    //std::cout << "drawline" << std::endl;
	glBegin(GL_LINES);
		glColor3f(fromColor.getX(), fromColor.getY(), fromColor.getZ());
		glVertex3d(from.getX(), from.getY(), from.getZ());
		glColor3f(toColor.getX(), toColor.getY(), toColor.getZ());
		glVertex3d(to.getX(), to.getY(), to.getZ());
	glEnd();
}
开发者ID:voidah,项目名称:tak,代码行数:10,代码来源:gldebugdrawer.cpp

示例11:

void nau::world::BulletDebugger::drawLine(const btVector3 & from, const btVector3 & to, const btVector3 & color) {
	points->push_back(from.getX());
	points->push_back(from.getY());
	points->push_back(from.getZ());
	points->push_back(1.0f);
	points->push_back(to.getX());
	points->push_back(to.getY());
	points->push_back(to.getZ());
	points->push_back(1.0f);
}
开发者ID:david-leal,项目名称:nau,代码行数:10,代码来源:bulletDebugger.cpp

示例12: drawLine

void BulletDebugDraw::drawLine(const btVector3& from,const btVector3& to,const btVector3& color)
{
//  DEBUG_PRINTF( "%s\n", __PRETTY_FUNCTION__ );

  Integration::DynamicsDebugVertex vertex;
  vertex.position = Vector3( from.getX(), from.getY(), from.getZ() );
  vertex.color = Vector4( color.getX(), color.getY(), color.getZ(), 1.0f );
  mVertices.push_back( vertex );
  vertex.position = Vector3( to.getX(), to.getY(), to.getZ());
  mVertices.push_back( vertex );
}
开发者ID:Tarnyko,项目名称:dali-adaptor,代码行数:11,代码来源:bullet-dynamics-debug.cpp

示例13: drawTriangle

void RigidSceneDebug::drawTriangle(const btVector3& a,const btVector3& b,const btVector3& c,const btVector3& color,btScalar alpha)
{
//	const btVector3	n=cross(b-a,c-a).normalized();
	glBegin(GL_TRIANGLES);		
	glColor4f(color.getX(), color.getY(), color.getZ(),alpha);
//	glNormal3d(n.getX(),n.getY(),n.getZ());
	glVertex3d(a.getX(),a.getY(),a.getZ());
	glVertex3d(b.getX(),b.getY(),b.getZ());
	glVertex3d(c.getX(),c.getY(),c.getZ());
	glEnd();
}
开发者ID:PH3NIX,项目名称:CubicVR,代码行数:11,代码来源:RigidSceneDebug.cpp

示例14: drawLine

void DebugDrawer::drawLine(const btVector3& from,const btVector3& to,const btVector3& color)
{
    if(!m_line_callback)
        return;
    float data[9] = {
        from.getX(), from.getY(), from.getZ(),
        to.getX(), to.getY(), to.getZ(),
        color.getX(), color.getY(), color.getZ()
    };
    m_line_callback(&data[0]);
}
开发者ID:chino,项目名称:pxr,代码行数:11,代码来源:debug_drawer.cpp

示例15:

void CGmObjPhysMan::CGLDebugDrawer::drawLine(const btVector3& from,const btVector3& to,const btVector3& color)
{
	if (m_debugMode > 0)
	{
		glBegin(GL_LINES);
		glColor4f(color.getX(), color.getY(), color.getZ(),1.f);
		glVertex3d(from.getX(), from.getY(), from.getZ());
		glVertex3d(to.getX(), to.getY(), to.getZ());
		glEnd();
	}
}
开发者ID:0rel,项目名称:okkuplektor,代码行数:11,代码来源:GmObjPhysMan.cpp


注:本文中的btVector3::getX方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。