Rev 1782 | Rev 1800 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 1720 | chris | 1 | package com.gebauz.bauzoid2.graphics.model; |
| 2 | |||
| 1782 | chris | 3 | import com.gebauz.bauzoid2.math.Matrix4; |
| 1778 | chris | 4 | import com.gebauz.bauzoid2.math.Quaternion; |
| 5 | import com.gebauz.bauzoid2.math.Vector3; |
||
| 6 | |||
| 1720 | chris | 7 | /** |
| 8 | * Created by chris on 14.12.2014. |
||
| 9 | */ |
||
| 10 | public class ModelPart |
||
| 11 | { |
||
| 12 | // Constants======================================================================================== |
||
| 13 | |||
| 14 | |||
| 1778 | chris | 15 | |
| 1720 | chris | 16 | // Fields=========================================================================================== |
| 17 | |||
| 18 | private String mName = null; |
||
| 19 | |||
| 20 | private MeshGroup mMeshGroup = null; |
||
| 21 | private Material mMaterial = null; |
||
| 22 | |||
| 1779 | chris | 23 | private ModelNode[] mBoneInfluences = null; |
| 1782 | chris | 24 | private Matrix4[] mMatrices = null; |
| 1779 | chris | 25 | |
| 1720 | chris | 26 | // Methods========================================================================================== |
| 27 | |||
| 28 | public ModelPart(String name, MeshGroup group, Material material) |
||
| 29 | { |
||
| 30 | mName = name; |
||
| 31 | |||
| 32 | mMeshGroup = group; |
||
| 33 | mMaterial = material; |
||
| 34 | } |
||
| 35 | |||
| 1788 | chris | 36 | public Matrix4[] calcBoneMatrices() |
| 37 | { |
||
| 38 | mMatrices = new Matrix4[mBoneInfluences.length]; |
||
| 39 | for (int i = 0; i < mMatrices.length; i++) |
||
| 40 | mMatrices[i] = Matrix4.createIdentity(); |
||
| 41 | |||
| 42 | return mMatrices; |
||
| 43 | } |
||
| 44 | |||
| 1720 | chris | 45 | // Getters/Setters================================================================================== |
| 1723 | chris | 46 | |
| 1777 | chris | 47 | public final Material getMaterial() { return mMaterial; } |
| 1723 | chris | 48 | |
| 1777 | chris | 49 | public final MeshGroup getMeshGroup() { return mMeshGroup; } |
| 50 | |||
| 1780 | chris | 51 | public final void setBoneInfluences(ModelNode[] influences) |
| 52 | { |
||
| 53 | mBoneInfluences = influences; |
||
| 54 | |||
| 1782 | chris | 55 | mMatrices = new Matrix4[influences.length]; |
| 56 | for (int i = 0; i < mMatrices.length; i++) |
||
| 57 | mMatrices[i] = Matrix4.createIdentity(); |
||
| 1780 | chris | 58 | } |
| 1782 | chris | 59 | |
| 1779 | chris | 60 | public final ModelNode[] getBoneInfluences() { return mBoneInfluences; } |
| 61 | |||
| 1782 | chris | 62 | public final Matrix4[] getBoneMatrices() { return mMatrices; } |
| 63 | |||
| 64 | |||
| 1720 | chris | 65 | } |