*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
{
static const std::map<Property::Type, Constraint (*)(Actor&, Property::Index)> sConstraintFactory = {
{Property::Type::BOOLEAN,
{
static const std::map<Property::Type, Constraint (*)(Actor&, Property::Index)> sConstraintFactory = {
{Property::Type::BOOLEAN,
- [](Actor& a, Property::Index i)
- {
- return Constraint::New<bool>(a, i, [](bool& current, const PropertyInputContainer& inputs)
- { current = inputs[0]->GetBoolean(); });
+ [](Actor& a, Property::Index i) {
+ return Constraint::New<bool>(a, i, [](bool& current, const PropertyInputContainer& inputs) { current = inputs[0]->GetBoolean(); });
- [](Actor& a, Property::Index i)
- {
- return Constraint::New<int>(a, i, [](int& current, const PropertyInputContainer& inputs)
- { current = inputs[0]->GetInteger(); });
+ [](Actor& a, Property::Index i) {
+ return Constraint::New<int>(a, i, [](int& current, const PropertyInputContainer& inputs) { current = inputs[0]->GetInteger(); });
return Constraint::New<float>(a, i, EqualToConstraint());
}},
{Property::Type::VECTOR2,
return Constraint::New<float>(a, i, EqualToConstraint());
}},
{Property::Type::VECTOR2,
return Constraint::New<Vector2>(a, i, EqualToConstraint());
}},
{Property::Type::VECTOR3,
return Constraint::New<Vector2>(a, i, EqualToConstraint());
}},
{Property::Type::VECTOR3,
return Constraint::New<Vector3>(a, i, EqualToConstraint());
}},
{Property::Type::VECTOR4,
return Constraint::New<Vector3>(a, i, EqualToConstraint());
}},
{Property::Type::VECTOR4,
return Constraint::New<Matrix>(a, i, EqualToConstraint());
}},
{Property::Type::MATRIX3,
return Constraint::New<Matrix>(a, i, EqualToConstraint());
}},
{Property::Type::MATRIX3,
return Constraint::New<Matrix3>(a, i, EqualToConstraint());
}},
{Property::Type::ROTATION,
return Constraint::New<Matrix3>(a, i, EqualToConstraint());
}},
{Property::Type::ROTATION,
- sJointDebugShader = Shader::New(SHADER_SCENE3D_JOINT_DEBUG_VERT, SHADER_SCENE3D_JOINT_DEBUG_FRAG);
+ sJointDebugShader = Shader::New(SHADER_SCENE3D_JOINT_DEBUG_VERT, SHADER_SCENE3D_JOINT_DEBUG_FRAG, Shader::Hint::NONE, "SCENE3D_JOINT_DEBUG");
- requests.erase(std::remove_if(requests.begin(), requests.end(), [](const RequestType& sscr)
- { return !sscr.mShader; }),
+ requests.erase(std::remove_if(requests.begin(), requests.end(), [](const RequestType& sscr) { return !sscr.mShader; }),
std::ostringstream stream;
stream << n.mName << " (" << n.mParentIdx << "):";
for(auto i : n.mChildren)
std::ostringstream stream;
stream << n.mName << " (" << n.mParentIdx << "):";
for(auto i : n.mChildren)
auto& thisNodes = mNodes;
unsigned int numReset = 0;
std::function<void(std::unique_ptr<NodeDefinition>&)> resetFn =
auto& thisNodes = mNodes;
unsigned int numReset = 0;
std::function<void(std::unique_ptr<NodeDefinition>&)> resetFn =
- [&thisNodes, &resetFn, &numReset](std::unique_ptr<NodeDefinition>& nd)
- {
- LOGD(("resetting %d", &nd - thisNodes.data()));
- for(auto i : nd->mChildren)
- {
- resetFn(thisNodes[i]);
- }
- nd.reset();
- ++numReset;
- };
+ [&thisNodes, &resetFn, &numReset](std::unique_ptr<NodeDefinition>& nd) {
+ LOGD(("resetting %d", &nd - thisNodes.data()));
+ for(auto i : nd->mChildren)
+ {
+ resetFn(thisNodes[i]);
+ }
+ nd.reset();
+ ++numReset;
+ };
auto iFind = std::lower_bound(offsets.begin(), offsets.end(), i);
if(iFind != offsets.end() && *iFind == i)
{
auto iFind = std::lower_bound(offsets.begin(), offsets.end(), i);
if(iFind != offsets.end() && *iFind == i)
{
void SceneDefinition::GetNodeModelStack(Index index, MatrixStack& model) const
{
auto& thisNodes = mNodes;
void SceneDefinition::GetNodeModelStack(Index index, MatrixStack& model) const
{
auto& thisNodes = mNodes;
- auto iFind = std::find_if(iBegin, iEnd, [&name](const std::unique_ptr<NodeDefinition>& nd)
- { return nd->mName == name; });
+ auto iFind = std::find_if(iBegin, iEnd, [&name](const std::unique_ptr<NodeDefinition>& nd) { return nd->mName == name; });
- auto iFind = std::find_if(iBegin, iEnd, [&name](const std::unique_ptr<NodeDefinition>& nd)
- { return nd->mName == name; });
+ auto iFind = std::find_if(iBegin, iEnd, [&name](const std::unique_ptr<NodeDefinition>& nd) { return nd->mName == name; });
- auto iFind = std::find_if(iBegin, iEnd, [&node](const std::unique_ptr<NodeDefinition>& n)
- { return n.get() == &node; });
+ auto iFind = std::find_if(iBegin, iEnd, [&node](const std::unique_ptr<NodeDefinition>& n) { return n.get() == &node; });
// We're searching from the end assuming a higher probability of operations targeting
// recently added nodes. (conf.: root, which is immovable, cannot be removed, and was
// the first to be added, is index 0.)
// We're searching from the end assuming a higher probability of operations targeting
// recently added nodes. (conf.: root, which is immovable, cannot be removed, and was
// the first to be added, is index 0.)
- auto iFind = std::find_if(mNodes.rbegin(), mNodes.rend(), [&name](const std::unique_ptr<NodeDefinition>& nd)
- { return nd->mName == name; })
+ auto iFind = std::find_if(mNodes.rbegin(), mNodes.rend(), [&name](const std::unique_ptr<NodeDefinition>& nd) { return nd->mName == name; })