Fixed texture wrapping, meshes as bones, wrap/cycle mixup.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4063 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -582,10 +582,10 @@ public class Model extends ModelNode
|
||||
if (_anim.repeatType == Controller.RT_CLAMP) {
|
||||
_nidx = Math.min(_nidx + 1, nframes - 1);
|
||||
|
||||
} else if (_anim.repeatType == Controller.RT_CYCLE) {
|
||||
} else if (_anim.repeatType == Controller.RT_WRAP) {
|
||||
_nidx = (_nidx + 1) % nframes;
|
||||
|
||||
} else { // _anim.repeatType == Controller.RT_WRAP
|
||||
} else { // _anim.repeatType == Controller.RT_CYCLE
|
||||
if ((_nidx + _fdir) < 0 || (_nidx + _fdir) >= nframes) {
|
||||
_fdir *= -1; // reverse direction
|
||||
}
|
||||
|
||||
@@ -89,7 +89,8 @@ public class ModelMesh extends TriMesh
|
||||
{
|
||||
_boundingType = "sphere".equals(props.getProperty("bound")) ?
|
||||
SPHERE_BOUND : BOX_BOUND;
|
||||
_texture = props.getProperty("texture", texture);
|
||||
_texture = (texture == null) ? null :
|
||||
props.getProperty(texture, texture);
|
||||
_solid = solid;
|
||||
_transparent = transparent;
|
||||
}
|
||||
|
||||
@@ -146,10 +146,12 @@ public class ModelDef
|
||||
// documentation inherited
|
||||
public Spatial createSpatial (Properties props)
|
||||
{
|
||||
_mesh = createMesh();
|
||||
configureMesh(props);
|
||||
ModelNode node = new ModelNode(name);
|
||||
node.attachChild(_mesh);
|
||||
if (indices.size() > 0) {
|
||||
_mesh = createMesh();
|
||||
configureMesh(props);
|
||||
node.attachChild(_mesh);
|
||||
}
|
||||
return node;
|
||||
}
|
||||
|
||||
@@ -227,6 +229,9 @@ public class ModelDef
|
||||
public void resolveReferences (HashMap<String, Spatial> nodes)
|
||||
{
|
||||
super.resolveReferences(nodes);
|
||||
if (_mesh == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// divide the vertices up by weight groups
|
||||
HashMap<HashSet<ModelNode>, WeightGroupDef> groups =
|
||||
|
||||
@@ -452,6 +452,7 @@ public class ModelViewer extends JmeCanvasApp
|
||||
}
|
||||
Texture tex = TextureManager.loadTexture(file.toString(),
|
||||
Texture.MM_LINEAR_LINEAR, Texture.FM_LINEAR);
|
||||
tex.setWrap(Texture.WM_WRAP_S_WRAP_T);
|
||||
if (tex == null) {
|
||||
Log.warning("Couldn't find texture [path=" + file +
|
||||
"].");
|
||||
|
||||
@@ -96,7 +96,7 @@ macroScript TRModelExporter category:"File" \
|
||||
(
|
||||
local kind
|
||||
isMesh = false
|
||||
if isKindOf node Editable_Mesh then (
|
||||
if isKindOf node Editable_Mesh and not node.boneEnable then (
|
||||
isMesh = true
|
||||
if isProperty node #skin or isProperty node #physique then (
|
||||
kind = "skinMesh"
|
||||
|
||||
Reference in New Issue
Block a user