载入中...
搜索中...
未找到
AnimLattice.cpp
浏览该文件的文档.
70int AnimLattice::pointIndex(int ix, int iy, int iz) const { return (iz * divY_ + iy) * divX_ + ix; }
74 throw Exception("AnimLattice: invalid control point (%d,%d,%d) for divisions (%d,%d,%d)", ix, iy, iz, divX_,
169void AnimLattice::computeCell(float x, float y, float z, int& i0, int& j0, int& k0, float& fu, float& fv,
224bool AnimLattice::deformPositionsTo(const std::vector<float>& inPosXYZ, std::vector<float>& outPosXYZ) const {
232bool AnimLattice::deformNormals(const float* posXYZ, const float* inNrmXYZ, float* outNrmXYZ, int count) const {
296bool AnimLattice::updateDeformedNormals(const std::vector<float>& posXYZ, const std::vector<float>& inNrmXYZ) {
void setDivisions(int divX, int divY, int divZ)
Changes divisions; resets all control points to identity and clears the bind.
Definition AnimLattice.cpp:43
float getDeformedPositionX(int vertexIndex) const
Cached deformed position component (requires updateDeformedPositions).
Definition AnimLattice.cpp:311
std::vector< float > getDeformedNormals() const
Copy of the cached deformed normals (xyz packed; empty when not updated).
Definition AnimLattice.cpp:337
std::vector< float > getDeformedPositions() const
Copy of the cached deformed positions (xyz packed; empty when not updated).
Definition AnimLattice.cpp:333
void setPointScale(int ix, int iy, int iz, float sx, float sy, float sz)
Per-control-point scale (squash / stretch about the lattice origin).
Definition AnimLattice.cpp:85
float getPointOffsetX(int ix, int iy, int iz) const
Returns the point offset x.
Definition AnimLattice.cpp:123
bool updateDeformedPositions()
Deform the bound bind positions into the internal cache.
Definition AnimLattice.cpp:288
bool deformNormals(const float *posXYZ, const float *inNrmXYZ, float *outNrmXYZ, int count) const
Transforms normals with the interpolated scale field and renormalizes. posXYZ provides the (deformed)...
Definition AnimLattice.cpp:232
float getBindPositionZ(int vertexIndex) const
Returns the bind position z.
Definition AnimLattice.cpp:164
void setOrigin(float ox, float oy, float oz)
Center of the lattice box in model space.
Definition AnimLattice.cpp:64
bool updateDeformedNormals(const std::vector< float > &posXYZ, const std::vector< float > &inNrmXYZ)
Deform packed xyz normals (with packed positions for cell lookup) into the internal normal cache.
Definition AnimLattice.cpp:296
float getPointScaleX(int ix, int iy, int iz) const
Returns the point scale x.
Definition AnimLattice.cpp:111
void deformPositions(const float *inPosXYZ, float *outPosXYZ, int count) const
Deforms count packed xyz positions into outPosXYZ. Both buffers must hold count * 3 floats; count mus...
Definition AnimLattice.cpp:179
float getPointOffsetY(int ix, int iy, int iz) const
Returns the point offset y.
Definition AnimLattice.cpp:127
float getDeformedPositionY(int vertexIndex) const
Returns the deformed position y.
Definition AnimLattice.cpp:318
void setSize(float sx, float sy, float sz)
World-space size of the lattice box (components must be > 0).
Definition AnimLattice.cpp:55
float getDeformedPositionZ(int vertexIndex) const
Returns the deformed position z.
Definition AnimLattice.cpp:325
void setPointOffset(int ix, int iy, int iz, float dx, float dy, float dz)
Per-control-point translation offset (local bulge / pinch).
Definition AnimLattice.cpp:93
float getPointScaleY(int ix, int iy, int iz) const
Returns the point scale y.
Definition AnimLattice.cpp:115
void setScale(float sx, float sy, float sz)
Applies one scale to every control point (whole-lattice squash & stretch).
Definition AnimLattice.cpp:101
static constexpr int kMinDivisions
Definition AnimLattice.h:44
bool deformPositionsTo(const std::vector< float > &inPosXYZ, std::vector< float > &outPosXYZ) const
Convenience: deform into a vector sized count*3.
Definition AnimLattice.cpp:224
float getBindPositionX(int vertexIndex) const
Bind-pose position component for vertex v (0..vertexCount-1).
Definition AnimLattice.cpp:156
float getPointOffsetZ(int ix, int iy, int iz) const
Returns the point offset z.
Definition AnimLattice.cpp:131
void reset()
Resets every control point to identity (offset 0, scale 1).
Definition AnimLattice.cpp:109
float getPointScaleZ(int ix, int iy, int iz) const
Returns the point scale z.
Definition AnimLattice.cpp:119
void bindPositions(const float *posXYZ, int count)
Binds a packed xyz array (count * 3 floats). Uses current divisions/size/origin.
Definition AnimLattice.cpp:136
float getBindPositionY(int vertexIndex) const
Returns the bind position y.
Definition AnimLattice.cpp:160
Definition Animation.cpp:58
@ Exception