Browse Source

Add pyMatrix and pyGeometry to pfPython PCH

This also includes some header debloat and const/reference fixes
(particularly in pyMatrix44). This will result in the generation of
slightly more efficient code.
Adam Johnson 13 years ago
parent
commit
d690df1064
  1. 2
      Sources/Plasma/FeatureLib/pfPython/Pch.h
  2. 2
      Sources/Plasma/FeatureLib/pfPython/cyMiscGlue4.cpp
  3. 4
      Sources/Plasma/FeatureLib/pfPython/cyPhysics.cpp
  4. 4
      Sources/Plasma/FeatureLib/pfPython/cyPhysicsGlue.cpp
  5. 4
      Sources/Plasma/FeatureLib/pfPython/cyPythonInterface.cpp
  6. 2
      Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp
  7. 2
      Sources/Plasma/FeatureLib/pfPython/pyCritterBrain.cpp
  8. 2
      Sources/Plasma/FeatureLib/pfPython/pyCritterBrainGlue.cpp
  9. 2
      Sources/Plasma/FeatureLib/pfPython/pyDniCoordinatesGlue.cpp
  10. 1
      Sources/Plasma/FeatureLib/pfPython/pyGUIControl.h
  11. 2
      Sources/Plasma/FeatureLib/pfPython/pyGeometry3.cpp
  12. 38
      Sources/Plasma/FeatureLib/pfPython/pyGeometry3.h
  13. 3
      Sources/Plasma/FeatureLib/pfPython/pyGeometry3Glue.cpp
  14. 1
      Sources/Plasma/FeatureLib/pfPython/pyImage.h
  15. 1
      Sources/Plasma/FeatureLib/pfPython/pyJournalBook.h
  16. 73
      Sources/Plasma/FeatureLib/pfPython/pyMatrix44.cpp
  17. 53
      Sources/Plasma/FeatureLib/pfPython/pyMatrix44.h
  18. 4
      Sources/Plasma/FeatureLib/pfPython/pyMatrix44Glue.cpp
  19. 2
      Sources/Plasma/FeatureLib/pfPython/pyNotify.cpp
  20. 2
      Sources/Plasma/FeatureLib/pfPython/pyNotifyGlue.cpp
  21. 3
      Sources/Plasma/FeatureLib/pfPython/pySceneObject.cpp
  22. 4
      Sources/Plasma/FeatureLib/pfPython/pySceneObjectGlue.cpp
  23. 2
      Sources/Plasma/FeatureLib/pfPython/pyWaveSetGlue.cpp

2
Sources/Plasma/FeatureLib/pfPython/Pch.h

@ -83,7 +83,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
// pfPython Components // pfPython Components
// Be very careful to include only isolated components here // Be very careful to include only isolated components here
#include "pyGeometry3.h"
#include "pyGlueHelpers.h" #include "pyGlueHelpers.h"
#include "pyKey.h" #include "pyKey.h"
#include "pyMatrix44.h"
#endif #endif

2
Sources/Plasma/FeatureLib/pfPython/cyMiscGlue4.cpp

@ -41,6 +41,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/ *==LICENSE==*/
#include <Python.h> #include <Python.h>
#include "pyGeometry3.h"
#include "pyKey.h" #include "pyKey.h"
#include "plPipeline.h" #include "plPipeline.h"
#pragma hdrstop #pragma hdrstop
@ -49,7 +50,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "pyGlueHelpers.h" #include "pyGlueHelpers.h"
#include "pySceneObject.h" #include "pySceneObject.h"
#include "pyAgeInfoStruct.h" #include "pyAgeInfoStruct.h"
#include "pyGeometry3.h"
#include "pnNetBase/pnNetBase.h" #include "pnNetBase/pnNetBase.h"
#include "pnUtils/pnUtils.h" #include "pnUtils/pnUtils.h"

4
Sources/Plasma/FeatureLib/pfPython/cyPhysics.cpp

@ -42,9 +42,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include <Python.h> #include <Python.h>
#include "plgDispatch.h" #include "plgDispatch.h"
#include "pyGeometry3.h"
#include "pnKeyedObject/plKey.h" #include "pnKeyedObject/plKey.h"
#include "pyKey.h" #include "pyKey.h"
#include "hsQuat.h" #include "hsQuat.h"
#include "pyMatrix44.h"
#pragma hdrstop #pragma hdrstop
#include "cyPhysics.h" #include "cyPhysics.h"
@ -56,8 +58,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plMessage/plLinearVelocityMsg.h" #include "plMessage/plLinearVelocityMsg.h"
#include "plMessage/plAngularVelocityMsg.h" #include "plMessage/plAngularVelocityMsg.h"
#include "pyGeometry3.h"
#include "pyMatrix44.h"
#include "pnSceneObject/plSceneObject.h" #include "pnSceneObject/plSceneObject.h"
#include "pnSceneObject/plCoordinateInterface.h" #include "pnSceneObject/plCoordinateInterface.h"

4
Sources/Plasma/FeatureLib/pfPython/cyPhysicsGlue.cpp

@ -41,12 +41,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/ *==LICENSE==*/
#include <Python.h> #include <Python.h>
#include "pyGeometry3.h"
#include "pyKey.h" #include "pyKey.h"
#include "pyMatrix44.h"
#pragma hdrstop #pragma hdrstop
#include "cyPhysics.h" #include "cyPhysics.h"
#include "pyGeometry3.h"
#include "pyMatrix44.h"
// glue functions // glue functions
PYTHON_CLASS_DEFINITION(ptPhysics, cyPhysics); PYTHON_CLASS_DEFINITION(ptPhysics, cyPhysics);

4
Sources/Plasma/FeatureLib/pfPython/cyPythonInterface.cpp

@ -49,7 +49,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include <Python.h> #include <Python.h>
#include <marshal.h> #include <marshal.h>
#include "pyGeometry3.h"
#include "pyKey.h" #include "pyKey.h"
#include "pyMatrix44.h"
#pragma hdrstop #pragma hdrstop
#include "cyPythonInterface.h" #include "cyPythonInterface.h"
@ -64,8 +66,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "cyCamera.h" #include "cyCamera.h"
#include "pyNotify.h" #include "pyNotify.h"
#include "cyAvatar.h" #include "cyAvatar.h"
#include "pyGeometry3.h"
#include "pyMatrix44.h"
#include "pyColor.h" #include "pyColor.h"
#include "pyDynamicText.h" #include "pyDynamicText.h"
#include "cyAnimation.h" #include "cyAnimation.h"

2
Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp

@ -51,6 +51,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include <Python.h> #include <Python.h>
#include "HeadSpin.h" #include "HeadSpin.h"
#include "plgDispatch.h" #include "plgDispatch.h"
#include "pyGeometry3.h"
#include "pyKey.h" #include "pyKey.h"
#include "hsResMgr.h" #include "hsResMgr.h"
#include "hsStream.h" #include "hsStream.h"
@ -113,7 +114,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "cyCamera.h" #include "cyCamera.h"
#include "pyNotify.h" #include "pyNotify.h"
#include "cyAvatar.h" #include "cyAvatar.h"
#include "pyGeometry3.h"
#include "pyVault.h" #include "pyVault.h"
#include "pyVaultNode.h" #include "pyVaultNode.h"
#include "pyVaultNodeRef.h" #include "pyVaultNodeRef.h"

2
Sources/Plasma/FeatureLib/pfPython/pyCritterBrain.cpp

@ -41,11 +41,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/ *==LICENSE==*/
#include <Python.h> #include <Python.h>
#include "pyGeometry3.h"
#include "pyKey.h" #include "pyKey.h"
#pragma hdrstop #pragma hdrstop
#include "pyCritterBrain.h" #include "pyCritterBrain.h"
#include "pyGeometry3.h"
#include "pySceneObject.h" #include "pySceneObject.h"
#include "plAvatar/plAvBrainCritter.h" #include "plAvatar/plAvBrainCritter.h"

2
Sources/Plasma/FeatureLib/pfPython/pyCritterBrainGlue.cpp

@ -41,12 +41,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/ *==LICENSE==*/
#include <Python.h> #include <Python.h>
#include "pyGeometry3.h"
#include "pyKey.h" #include "pyKey.h"
#pragma hdrstop #pragma hdrstop
#include "pyCritterBrain.h" #include "pyCritterBrain.h"
#include "pyEnum.h" #include "pyEnum.h"
#include "pyGeometry3.h"
#include "plMessage/plAIMsg.h" #include "plMessage/plAIMsg.h"

2
Sources/Plasma/FeatureLib/pfPython/pyDniCoordinatesGlue.cpp

@ -41,10 +41,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/ *==LICENSE==*/
#include <Python.h> #include <Python.h>
#include "pyGeometry3.h"
#pragma hdrstop #pragma hdrstop
#include "pyDniCoordinates.h" #include "pyDniCoordinates.h"
#include "pyGeometry3.h"
#include "plVault/plDniCoordinateInfo.h" #include "plVault/plDniCoordinateInfo.h"
// glue functions // glue functions

1
Sources/Plasma/FeatureLib/pfPython/pyGUIControl.h

@ -49,7 +49,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
#include "pyGeometry3.h"
#include "pyGlueHelpers.h" #include "pyGlueHelpers.h"
#include "pnKeyedObject/plKey.h" #include "pnKeyedObject/plKey.h"

2
Sources/Plasma/FeatureLib/pfPython/pyGeometry3.cpp

@ -40,5 +40,5 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/ *==LICENSE==*/
#pragma hdrstop
#include "pyGeometry3.h" #include "pyGeometry3.h"
#pragma hdrstop

38
Sources/Plasma/FeatureLib/pfPython/pyGeometry3.h

@ -57,7 +57,7 @@ class pyPoint3
protected: protected:
pyPoint3() : fPoint(0,0,0) {} pyPoint3() : fPoint(0,0,0) {}
pyPoint3(float x, float y, float z) : fPoint(x,y,z) {} pyPoint3(float x, float y, float z) : fPoint(x,y,z) {}
pyPoint3(hsPoint3 pt) : fPoint(pt.fX,pt.fY,pt.fZ) {} pyPoint3(const hsPoint3& pt) : fPoint(pt) {}
public: public:
// required functions for PyObject interoperability // required functions for PyObject interoperability
@ -72,9 +72,9 @@ public:
hsPoint3 fPoint; hsPoint3 fPoint;
// python get attributes helpers // python get attributes helpers
float getX() { return fPoint.fX; } float getX() const { return fPoint.fX; }
float getY() { return fPoint.fY; } float getY() const { return fPoint.fY; }
float getZ() { return fPoint.fZ; } float getZ() const { return fPoint.fZ; }
// python set attributes helpers // python set attributes helpers
void setX(float x) { fPoint.fX = x; } void setX(float x) { fPoint.fX = x; }
@ -83,9 +83,9 @@ public:
// methods to manipulate point3's // methods to manipulate point3's
void Zero() { fPoint.fX=0; fPoint.fY=0; fPoint.fZ=0; } void Zero() { fPoint.fX=0; fPoint.fY=0; fPoint.fZ=0; }
PyObject* Copy() { return pyPoint3::New(fPoint); } PyObject* Copy() const { return pyPoint3::New(fPoint); }
float Distance(pyPoint3 other) { return hsVector3(&fPoint,&other.fPoint).Magnitude(); } float Distance(const pyPoint3& other) const { return hsVector3(&fPoint, &other.fPoint).Magnitude(); }
float DistanceSquared(pyPoint3 other) { return hsVector3(&fPoint,&other.fPoint).MagnitudeSquared(); } float DistanceSquared(const pyPoint3& other) const { return hsVector3(&fPoint, &other.fPoint).MagnitudeSquared(); }
}; };
@ -94,7 +94,7 @@ class pyVector3
protected: protected:
pyVector3() : fVector(0,0,0) {} pyVector3() : fVector(0,0,0) {}
pyVector3(float x, float y, float z) : fVector(x,y,z) {} pyVector3(float x, float y, float z) : fVector(x,y,z) {}
pyVector3(hsVector3 v) : fVector(v.fX,v.fY,v.fZ) {} pyVector3(const hsVector3& v) : fVector(v) {}
public: public:
// required functions for PyObject interoperability // required functions for PyObject interoperability
@ -109,9 +109,9 @@ public:
hsVector3 fVector; hsVector3 fVector;
// python get attributes helpers // python get attributes helpers
float getX() { return fVector.fX; } float getX() const { return fVector.fX; }
float getY() { return fVector.fY; } float getY() const { return fVector.fY; }
float getZ() { return fVector.fZ; } float getZ() const { return fVector.fZ; }
// python set attributes helpers // python set attributes helpers
void setX(float x) { fVector.fX = x; } void setX(float x) { fVector.fX = x; }
@ -124,15 +124,15 @@ public:
// methods to manipulate vectors // methods to manipulate vectors
void Normalize() { fVector.Normalize(); } void Normalize() { fVector.Normalize(); }
float Dot(pyVector3 other) { return fVector*other.fVector;} float Dot(const pyVector3& other) { return fVector * other.fVector;}
PyObject* Cross(pyVector3 other) {return pyVector3::New(fVector%other.fVector); } PyObject* Cross(const pyVector3& other) const { return pyVector3::New(fVector % other.fVector); }
float Magnitude() { return fVector.Magnitude(); } float Magnitude() const { return fVector.Magnitude(); }
float MagnitudeSquared() { return fVector.MagnitudeSquared(); } float MagnitudeSquared() const { return fVector.MagnitudeSquared(); }
void Zero() { fVector.fX=0; fVector.fY=0; fVector.fZ=0; } void Zero() { fVector.fX=0; fVector.fY=0; fVector.fZ=0; }
PyObject* Scale(float scale) { return pyVector3::New(fVector * scale); } PyObject* Scale(float scale) const { return pyVector3::New(fVector * scale); }
PyObject* Add(pyVector3& other) { return pyVector3::New(fVector + other.fVector); } PyObject* Add(const pyVector3& other) const { return pyVector3::New(fVector + other.fVector); }
PyObject* Subtract(pyVector3& other) { return pyVector3::New(fVector - other.fVector); } PyObject* Subtract(const pyVector3& other) const { return pyVector3::New(fVector - other.fVector); }
PyObject* Copy() { return pyVector3::New(fVector); } PyObject* Copy() const { return pyVector3::New(fVector); }
}; };

3
Sources/Plasma/FeatureLib/pfPython/pyGeometry3Glue.cpp

@ -41,9 +41,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/ *==LICENSE==*/
#include <Python.h> #include <Python.h>
#pragma hdrstop
#include "pyGeometry3.h" #include "pyGeometry3.h"
#pragma hdrstop
// glue functions // glue functions
PYTHON_CLASS_DEFINITION(ptPoint3, pyPoint3); PYTHON_CLASS_DEFINITION(ptPoint3, pyPoint3);

1
Sources/Plasma/FeatureLib/pfPython/pyImage.h

@ -56,7 +56,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "pyColor.h" #include "pyColor.h"
#ifndef BUILDING_PYPLASMA #ifndef BUILDING_PYPLASMA
# include "pyGeometry3.h"
# include "plGImage/plMipmap.h" # include "plGImage/plMipmap.h"
#endif #endif

1
Sources/Plasma/FeatureLib/pfPython/pyJournalBook.h

@ -48,7 +48,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
#include "pyGeometry3.h"
#include "pyGlueHelpers.h" #include "pyGlueHelpers.h"
#include <string> #include <string>

73
Sources/Plasma/FeatureLib/pfPython/pyMatrix44.cpp

@ -41,21 +41,51 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/ *==LICENSE==*/
#include <Python.h> #include <Python.h>
#include "pyGeometry3.h"
#include "pyMatrix44.h"
#pragma hdrstop #pragma hdrstop
#include "pyMatrix44.h" PyObject* pyMatrix44::operator*(const pyVector3& p) const
{
return pyVector3::New(fMatrix * p.fVector);
}
PyObject* pyMatrix44::operator*(const pyPoint3& p) const
{
return pyPoint3::New(fMatrix * p.fPoint);
}
void pyMatrix44::Translate(const pyVector3& v)
{
fMatrix.Translate(&v.fVector);
}
void pyMatrix44::Scale(const pyVector3& v)
{
fMatrix.Scale(&v.fVector);
}
void pyMatrix44::MakeTranslateMat(const pyVector3& trans)
{
fMatrix.MakeTranslateMat(&trans.fVector);
}
pyMatrix44::pyMatrix44() { fMatrix.Reset(); } void pyMatrix44::MakeScaleMat(const pyVector3& scale)
pyMatrix44::pyMatrix44(hsMatrix44 other) {
{ // copy the other matrix to this one fMatrix.MakeScaleMat(&scale.fVector);
int i,j; }
for ( i=0;i<4;i++)
for ( j=0;j<4;j++) void pyMatrix44::Make(const pyPoint3& from, const pyPoint3& at, const pyVector3& up)
fMatrix.fMap[i][j] = other.fMap[i][j]; {
fMatrix.fFlags = other.fFlags; fMatrix.Make(&from.fPoint, &at.fPoint, &up.fVector);
} }
PyObject* pyMatrix44::GetInverse(PyObject* inverse) void pyMatrix44::MakeUpPreserving(const pyPoint3& from, const pyPoint3& at, const pyVector3& up)
{
fMatrix.MakeUpPreserving(&from.fPoint, &at.fPoint, &up.fVector);
}
PyObject* pyMatrix44::GetInverse(PyObject* inverse) const
{ {
pyMatrix44 *obj = pyMatrix44::ConvertFrom(inverse); pyMatrix44 *obj = pyMatrix44::ConvertFrom(inverse);
fMatrix.GetInverse(&(obj->fMatrix)); fMatrix.GetInverse(&(obj->fMatrix));
@ -63,7 +93,7 @@ PyObject* pyMatrix44::GetInverse(PyObject* inverse)
return inverse; return inverse;
} }
PyObject* pyMatrix44::GetTranspose(PyObject* transpose) PyObject* pyMatrix44::GetTranspose(PyObject* transpose) const
{ {
pyMatrix44 *obj = pyMatrix44::ConvertFrom(transpose); pyMatrix44 *obj = pyMatrix44::ConvertFrom(transpose);
fMatrix.GetTranspose(&(obj->fMatrix)); fMatrix.GetTranspose(&(obj->fMatrix));
@ -71,7 +101,7 @@ PyObject* pyMatrix44::GetTranspose(PyObject* transpose)
return transpose; return transpose;
} }
PyObject* pyMatrix44::GetAdjoint(PyObject* adjoint) PyObject* pyMatrix44::GetAdjoint(PyObject* adjoint) const
{ {
pyMatrix44 *obj = pyMatrix44::ConvertFrom(adjoint); pyMatrix44 *obj = pyMatrix44::ConvertFrom(adjoint);
fMatrix.GetAdjoint(&(obj->fMatrix)); fMatrix.GetAdjoint(&(obj->fMatrix));
@ -79,7 +109,7 @@ PyObject* pyMatrix44::GetAdjoint(PyObject* adjoint)
return adjoint; return adjoint;
} }
PyObject* pyMatrix44::GetTranslate(PyObject* pt) PyObject* pyMatrix44::GetTranslate(PyObject* pt) const
{ {
pyVector3 *obj = pyVector3::ConvertFrom(pt); pyVector3 *obj = pyVector3::ConvertFrom(pt);
fMatrix.GetTranslate(&(obj->fVector)); fMatrix.GetTranslate(&(obj->fVector));
@ -87,7 +117,22 @@ PyObject* pyMatrix44::GetTranslate(PyObject* pt)
return pt; return pt;
} }
float* pyMatrix44::GetData() PyObject* pyMatrix44::GetViewAxis() const
{
return pyVector3::New(fMatrix.GetAxis(hsMatrix44::kView));
}
PyObject* pyMatrix44::GetUpAxis() const
{
return pyVector3::New(fMatrix.GetAxis(hsMatrix44::kUp));
}
PyObject* pyMatrix44::GetRightAxis() const
{
return pyVector3::New(fMatrix.GetAxis(hsMatrix44::kRight));
}
float* pyMatrix44::GetData() const
{ {
float *res = new float[4*4]; float *res = new float[4*4];
res[0] = fMatrix.fMap[0][0]; res[1] = fMatrix.fMap[0][1]; res[2] = fMatrix.fMap[0][2]; res[3] = fMatrix.fMap[0][3]; res[0] = fMatrix.fMap[0][0]; res[1] = fMatrix.fMap[0][1]; res[2] = fMatrix.fMap[0][2]; res[3] = fMatrix.fMap[0][3];

53
Sources/Plasma/FeatureLib/pfPython/pyMatrix44.h

@ -43,16 +43,17 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#define pyMatrix44_h_inc #define pyMatrix44_h_inc
#include "hsMatrix44.h" #include "hsMatrix44.h"
#include "pyGeometry3.h"
#include "pyGlueHelpers.h" #include "pyGlueHelpers.h"
class pyPoint3;
class pyVector3;
class pyMatrix44 class pyMatrix44
{ {
protected: protected:
pyMatrix44(); pyMatrix44() { fMatrix.Reset(); }
pyMatrix44(hsMatrix44 other); pyMatrix44(const hsMatrix44& other) : fMatrix(other) { }
public: public:
// required functions for PyObject interoperability // required functions for PyObject interoperability
@ -68,31 +69,31 @@ public:
// operator methods // operator methods
PyObject* operator*(const pyMatrix44& b) const { return pyMatrix44::New(fMatrix * b.fMatrix); } // returns pyMatrix44 PyObject* operator*(const pyMatrix44& b) const { return pyMatrix44::New(fMatrix * b.fMatrix); } // returns pyMatrix44
PyObject* operator*(const pyVector3& p) const { return pyVector3::New(fMatrix * p.fVector); } // returns pyVector3 PyObject* operator*(const pyVector3& p) const;
PyObject* operator*(const pyPoint3& p) const { return pyPoint3::New(fMatrix * p.fPoint); } // returns pyPoint3 PyObject* operator*(const pyPoint3& p) const;
// other methods // other methods
PyObject* Copy() { return pyMatrix44::New(fMatrix); } // returns pyMatrix44 PyObject* Copy() const { return pyMatrix44::New(fMatrix); } // returns pyMatrix44
void Translate(pyVector3 v) { fMatrix.Translate(&v.fVector); } void Translate(const pyVector3& v);
void Scale(pyVector3 v) { fMatrix.Scale(&v.fVector); } void Scale(const pyVector3& v);
void Rotate(int axis, float radians) { fMatrix.Rotate(axis,radians); } void Rotate(int axis, float radians) { fMatrix.Rotate(axis, radians); }
void Reset() { fMatrix.Reset(); } void Reset() { fMatrix.Reset(); }
void MakeTranslateMat(pyVector3 trans) { fMatrix.MakeTranslateMat(&trans.fVector); } void MakeTranslateMat(const pyVector3& trans);
void MakeScaleMat(pyVector3 scale) { fMatrix.MakeScaleMat(&scale.fVector); } void MakeScaleMat(const pyVector3& scale);
void MakeRotateMat(int axis, float radians) { fMatrix.MakeRotateMat(axis,radians); } void MakeRotateMat(int axis, float radians) { fMatrix.MakeRotateMat(axis, radians); }
void Make(pyPoint3 from,pyPoint3 at,pyVector3 up) { fMatrix.Make(&from.fPoint,&at.fPoint,&up.fVector); } void Make(const pyPoint3& from, const pyPoint3& at, const pyVector3& up);
void MakeUpPreserving(pyPoint3 from,pyPoint3 at,pyVector3 up) { fMatrix.MakeUpPreserving(&from.fPoint,&at.fPoint,&up.fVector); } void MakeUpPreserving(const pyPoint3& from, const pyPoint3& at, const pyVector3& up);
hsBool GetParity() { return fMatrix.GetParity(); } hsBool GetParity() const { return fMatrix.GetParity(); }
float GetDeterminant() { return fMatrix.GetDeterminant(); } float GetDeterminant() const { return fMatrix.GetDeterminant(); }
PyObject* GetInverse(PyObject* inverse); // returns (and accepts) pyMatrix44 PyObject* GetInverse(PyObject* inverse) const; // returns (and accepts) pyMatrix44
PyObject* GetTranspose(PyObject* inverse); // returns (and accepts) pyMatrix44 PyObject* GetTranspose(PyObject* inverse) const; // returns (and accepts) pyMatrix44
PyObject* GetAdjoint(PyObject* adjoint); // returns (and accepts) pyMatrix44 PyObject* GetAdjoint(PyObject* adjoint) const; // returns (and accepts) pyMatrix44
PyObject* GetTranslate(PyObject* pt); // returns (and accepts) pyVector3 PyObject* GetTranslate(PyObject* pt) const; // returns (and accepts) pyVector3
PyObject* GetViewAxis() { return pyVector3::New(fMatrix.GetAxis(hsMatrix44::kView)); } // returns pyVector3 PyObject* GetViewAxis() const; // returns pyVector3
PyObject* GetUpAxis() { return pyVector3::New(fMatrix.GetAxis(hsMatrix44::kUp)); } // returns pyVector3 PyObject* GetUpAxis() const; // returns pyVector3
PyObject* GetRightAxis() { return pyVector3::New(fMatrix.GetAxis(hsMatrix44::kRight)); } // returns pyVector3 PyObject* GetRightAxis() const; // returns pyVector3
float* GetData(); float* GetData() const;
void SetData(const float mat[]); void SetData(const float mat[]);
}; };

4
Sources/Plasma/FeatureLib/pfPython/pyMatrix44Glue.cpp

@ -41,9 +41,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/ *==LICENSE==*/
#include <Python.h> #include <Python.h>
#pragma hdrstop #include "pyGeometry3.h"
#include "pyMatrix44.h" #include "pyMatrix44.h"
#pragma hdrstop
// glue functions // glue functions
PYTHON_CLASS_DEFINITION(ptMatrix44, pyMatrix44); PYTHON_CLASS_DEFINITION(ptMatrix44, pyMatrix44);

2
Sources/Plasma/FeatureLib/pfPython/pyNotify.cpp

@ -46,11 +46,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
#include "plgDispatch.h" #include "plgDispatch.h"
#include "pyGeometry3.h"
#include "pyKey.h" #include "pyKey.h"
#pragma hdrstop #pragma hdrstop
#include "pyNotify.h" #include "pyNotify.h"
#include "pyGeometry3.h"
pyNotify::pyNotify() pyNotify::pyNotify()

2
Sources/Plasma/FeatureLib/pfPython/pyNotifyGlue.cpp

@ -41,12 +41,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/ *==LICENSE==*/
#include <Python.h> #include <Python.h>
#include "pyGeometry3.h"
#include "pyKey.h" #include "pyKey.h"
#pragma hdrstop #pragma hdrstop
#include "pyNotify.h" #include "pyNotify.h"
#include "pyEnum.h" #include "pyEnum.h"
#include "pyGeometry3.h"
// glue functions // glue functions
PYTHON_CLASS_DEFINITION(ptNotify, pyNotify); PYTHON_CLASS_DEFINITION(ptNotify, pyNotify);

3
Sources/Plasma/FeatureLib/pfPython/pySceneObject.cpp

@ -43,11 +43,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include <Python.h> #include <Python.h>
#include "plAudible.h" #include "plAudible.h"
#include "plgDispatch.h" #include "plgDispatch.h"
#include "pyGeometry3.h"
#include "pyKey.h" #include "pyKey.h"
#include "pyMatrix44.h"
#include "plPhysical.h" #include "plPhysical.h"
#pragma hdrstop #pragma hdrstop
#include "pyMatrix44.h"
#include "pySceneObject.h" #include "pySceneObject.h"
#include "plResMgr/plResManager.h" #include "plResMgr/plResManager.h"

4
Sources/Plasma/FeatureLib/pfPython/pySceneObjectGlue.cpp

@ -41,12 +41,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/ *==LICENSE==*/
#include <Python.h> #include <Python.h>
#include "pyGeometry3.h"
#include "pyKey.h" #include "pyKey.h"
#include "pyMatrix44.h"
#pragma hdrstop #pragma hdrstop
#include "pySceneObject.h" #include "pySceneObject.h"
#include "pyMatrix44.h"
#include "pyGeometry3.h"
// glue functions // glue functions
PYTHON_CLASS_DEFINITION(ptSceneobject, pySceneObject); PYTHON_CLASS_DEFINITION(ptSceneobject, pySceneObject);

2
Sources/Plasma/FeatureLib/pfPython/pyWaveSetGlue.cpp

@ -41,11 +41,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/ *==LICENSE==*/
#include <Python.h> #include <Python.h>
#include "pyGeometry3.h"
#include "pyKey.h" #include "pyKey.h"
#pragma hdrstop #pragma hdrstop
#include "pyColor.h" #include "pyColor.h"
#include "pyGeometry3.h"
#include "pyWaveSet.h" #include "pyWaveSet.h"
// glue functions // glue functions

Loading…
Cancel
Save