本文整理汇总了C++中Light::SetColour方法的典型用法代码示例。如果您正苦于以下问题:C++ Light::SetColour方法的具体用法?C++ Light::SetColour怎么用?C++ Light::SetColour使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Light
的用法示例。
在下文中一共展示了Light::SetColour方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Update
void Branch::Update(float msec)
{
mesh->Update(msec);
SceneNode::Update(msec);
if (mesh->GetDrawIndices() == (branchSize * 24) && numLeafs < maxLeafs)
{
SceneNode* leaf = new SceneNode(sphere);
float leafpos = (float)((mesh->GetDrawIndices() / 24) / 5);
leaf->SetTransform(Matrix4::Translation(Vector3(0, leafpos * maxScale.y, 0)));
leaf->SetModelScale(Vector3(20,20,20));
AddChild(leaf);
leaf->Update(msec);
///////
PhysicsNode*p = new PhysicsNode();
float elements[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1};
Matrix4 mat = Matrix4(elements);
p->SetInverseInertia(mat);
p->SetUseGravity(false);
p->SetInverseMass(0.0f);
p->SetPosition(leaf->GetWorldTransform().GetPositionVector());
p->SetCollisionVolume(new CollisionLeaf(20));
Vector3 startPos = GetWorldTransform().GetPositionVector();
Vector3 endPos = leaf->GetWorldTransform().GetPositionVector();
PhysicsSystem::GetPhysicsSystem().AddNode(p);
/////////
Light l = Light();
l.SetPosition(leaf->GetWorldTransform().GetPositionVector());
l.SetColour(Vector4 (0, 1, 0, 1.0f));
l.SetRadius(150);
LightStorage::GetInstance()->addLight(l);
numLeafs++;
}
if (modelScale.x < maxScale.x)
{
modelScale.x += 0.000001;
modelScale.z += 0.000001;
}
if (!hasPhysics && GetWorldTransform().GetPositionVector().Length() != 0)
{
SceneNode* leaf = new SceneNode(sphere);
float leafpos = (float)((mesh->getNumInd() / 24) / 5);
leaf->SetTransform(Matrix4::Translation(Vector3(0, leafpos * maxScale.y, 0)));
AddChild(leaf);
leaf->Update(msec);
///////
PhysicsNode*p = new PhysicsNode();
float elements[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1};
Matrix4 mat = Matrix4(elements);
p->SetInverseInertia(mat);
p->SetUseGravity(false);
p->SetInverseMass(0.0f);
p->SetPosition(leaf->GetWorldTransform().GetPositionVector());
Vector3 startPos = GetWorldTransform().GetPositionVector();
Vector3 endPos = leaf->GetWorldTransform().GetPositionVector();
endBranch = endPos;
p->SetCollisionVolume(new CollisionCylinder(1, startPos, endPos));
myNode = p;
PhysicsSystem::GetPhysicsSystem().AddNode(p);
/////////
hasPhysics = true;
RemoveChild(leaf);
}
if (myNode)
//.........这里部分代码省略.........