reset change to getDirectionInWorld

This commit is contained in:
yangxiao 2014-09-28 11:03:18 +08:00
parent 53dee7ef86
commit 744e09c141
2 changed files with 6 additions and 6 deletions

View File

@ -76,9 +76,9 @@ const Vec3& DirectionLight3D::getDirection() const
dir.set(-mat.m[8], -mat.m[9], -mat.m[10]);
return dir;
}
Vec3 DirectionLight3D::getDirectionInWorld() const
const Vec3& DirectionLight3D::getDirectionInWorld() const
{
Vec3 dir;
static Vec3 dir;
Mat4 mat = getNodeToWorldTransform();
dir.set(-mat.m[8], -mat.m[9], -mat.m[10]);
return dir;
@ -139,9 +139,9 @@ const Vec3& SpotLight3D::getDirection() const
return dir;
}
Vec3 SpotLight3D::getDirectionInWorld() const
const Vec3& SpotLight3D::getDirectionInWorld() const
{
Vec3 dir;
static Vec3 dir;
Mat4 mat = getNodeToWorldTransform();
dir.set(-mat.m[8], -mat.m[9], -mat.m[10]);
return dir;

View File

@ -126,7 +126,7 @@ public:
/**
* Returns direction in world.
*/
Vec3 getDirectionInWorld() const;
const Vec3& getDirectionInWorld() const;
CC_CONSTRUCTOR_ACCESS:
DirectionLight3D();
@ -196,7 +196,7 @@ public:
/**
* Returns direction in world.
*/
Vec3 getDirectionInWorld() const;
const Vec3& getDirectionInWorld() const;
/**
* Sets the range of point or spot light.