Preparation for proper spline/bez: Convert control points to a simple format.

The bezier/spline code will no longer need to handle morph and splines,
when it's finally written. This is done by pre-skinning in software and
pre-decoding to get rid of the morph.
This commit is contained in:
Henrik Rydgard committed 2013-09-21 23:37:14 +02:00
1 parent c733f7a7ab
commit 82e5787bbe
16 files changed
+218 -68

No files matched your search

+2 -2
View File
@@ -118,14 +118,14 @@ static VertexData ReadVertex(VertexReader& vreader)
vertex.normal = -vertex.normal;
}
if (gstate.isSkinningEnabled() && !gstate.isModeThrough()) {
if (vertTypeIsSkinningEnabled(gstate.vertType) && !gstate.isModeThrough()) {
float W[8] = { 1.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f };
vreader.ReadWeights(W);
Vec3<float> tmppos(0.f, 0.f, 0.f);
Vec3<float> tmpnrm(0.f, 0.f, 0.f);
for (int i = 0; i < gstate.getNumBoneWeights(); ++i) {
for (int i = 0; i < vertTypeGetNumBoneWeights(gstate.vertType); ++i) {
Mat3x3<float> bone(&gstate.boneMatrix[12*i]);
tmppos += W[i] * (bone * ModelCoords(pos[0], pos[1], pos[2]) + Vec3<float>(gstate.boneMatrix[12*i+9], gstate.boneMatrix[12*i+10], gstate.boneMatrix[12*i+11]));
if (vreader.hasNormal())