Skip to content

Commit

Permalink
fix bug related with geometry name.
Browse files Browse the repository at this point in the history
  • Loading branch information
simonvy committed May 29, 2012
1 parent 87cabe2 commit c637fa1
Show file tree
Hide file tree
Showing 3 changed files with 209 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/ja3d/collisions/EllipsoidCollider.java
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ private void prepare(Vector3D source, Vector3D displacement,
}

triangleIndices.clear();
vertices.clear();
numTriangles = 0;

// Loop geometries
Expand Down
2 changes: 1 addition & 1 deletion src/ja3d/resources/Geometry.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public int getAttributeOffset(int attribute) {
}

public String getName() {
return "";
return _name;
}

public void setName(String value) {
Expand Down
207 changes: 207 additions & 0 deletions src/test/XIANGZI.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
<?xml version="1.0" encoding="utf-8"?>
<COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<asset>
<contributor>
<author>Administrator</author>
<authoring_tool>3dsMax 8 - Feeling ColladaMax v3.05B.</authoring_tool>
<comments>ColladaMax Export Options: ExportNormals=1;ExportEPolyAsTriangles=1;ExportXRefs=1;ExportSelected=0;ExportTangents=1;ExportAnimations=1;SampleAnim=0;ExportAnimClip=0;BakeMatrices=1;ExportRelativePaths=0;AnimStart=0;AnimEnd=3.33333;</comments>
<source_data>file:///G:/HZC%B9%A4%D7%F7%CF%EE%C4%BF/HZC/%B3%A1%BE%B0%B2%E2%CA%D4%A3%A8%CD%EA%D5%FB%B0%E6%A3%A9/Untitled.max</source_data>
</contributor>
<created>2012-05-28T09:21:26Z</created>
<modified>2012-05-28T09:21:27Z</modified>
<unit meter="0.01" name="centimeter"/>
<up_axis>Z_UP</up_axis>
</asset>
<library_images>
<image id="c_cq_xiangzi01.png" name="c_cq_xiangzi01_png">
<init_from>./asset/c_cq_xiangzi01.png</init_from>
</image>
</library_images>
<library_materials>
<material id="c_cq_xiangzi01" name="c_cq_xiangzi01">
<instance_effect url="#c_cq_xiangzi01-fx"/>
</material>
</library_materials>
<library_effects>
<effect id="c_cq_xiangzi01-fx" name="c_cq_xiangzi01">
<profile_COMMON>
<newparam sid="c_cq_xiangzi01_png-surface">
<surface type="2D">
<init_from>c_cq_xiangzi01.png</init_from>
<format>A8R8G8B8</format>
</surface>
</newparam>
<newparam sid="c_cq_xiangzi01_png-sampler">
<sampler2D>
<source>c_cq_xiangzi01_png-surface</source>
<wrap_s>WRAP</wrap_s>
<wrap_t>WRAP</wrap_t>
<minfilter>NONE</minfilter>
<magfilter>NONE</magfilter>
<mipfilter>NONE</mipfilter>
</sampler2D>
</newparam>
<technique sid="common">
<blinn>
<ambient>
<color>0.588235 0.588235 0.588235 1</color>
</ambient>
<diffuse>
<texture texture="c_cq_xiangzi01_png-sampler" texcoord="CHANNEL1">
<extra>
<technique profile="MAYA">
<mirrorU>0</mirrorU>
<mirrorV>0</mirrorV>
<wrapU>1</wrapU>
<wrapV>1</wrapV>
<repeatU>1</repeatU>
<repeatV>1</repeatV>
<offsetU>0</offsetU>
<offsetV>0</offsetV>
<rotateUV>0</rotateUV>
</technique>
<technique profile="MAX3D">
<amount>1</amount>
</technique>
</extra>
</texture>
</diffuse>
<specular>
<color>0.9 0.9 0.9 1</color>
</specular>
<shininess>
<float>0.415939</float>
</shininess>
<reflective>
<color>0 0 0 1</color>
</reflective>
<reflectivity>
<float>1</float>
</reflectivity>
<transparent opaque="A_ONE">
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>1</float>
</transparency>
</blinn>
<extra>
<technique profile="FCOLLADA">
<spec_level>
<float>0</float>
</spec_level>
<emission_level>
<float>0</float>
</emission_level>
</technique>
</extra>
</technique>
</profile_COMMON>
<extra>
<technique profile="MAX3D">
<faceted>0</faceted>
<double_sided>0</double_sided>
<wireframe>0</wireframe>
<face_map>0</face_map>
</technique>
</extra>
</effect>
</library_effects>
<library_geometries>
<geometry id="c_cq_xiangzi17-mesh" name="c_cq_xiangzi17">
<mesh>
<source id="c_cq_xiangzi17-mesh-positions">
<float_array id="c_cq_xiangzi17-mesh-positions-array" count="24">50 -50 0 50 50 0 -50 -50 0 -50 50 0 50 -50 100 50 50 100 -50 -50 100 -50 50 100</float_array>
<technique_common>
<accessor source="#c_cq_xiangzi17-mesh-positions-array" count="8" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="c_cq_xiangzi17-mesh-normals">
<float_array id="c_cq_xiangzi17-mesh-normals-array" count="72">0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 1 0 0 1 0 0 1 0 0 1 0.999999 0.001135 0 0.999999 0.001135 0 0.999999 0.001135 0 0.999999 0.001135 0 -0.001135 0.999999 0 -0.001135 0.999999 0 -0.001135 0.999999 0 -0.001135 0.999999 0 -0.999999 -0.001135 0 -0.999999 -0.001135 0 -0.999999 -0.001135 0 -0.999999 -0.001135 0 0.001135 -0.999999 0 0.001135 -0.999999 0 0.001135 -0.999999 0 0.001135 -0.999999 0</float_array>
<technique_common>
<accessor source="#c_cq_xiangzi17-mesh-normals-array" count="24" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="c_cq_xiangzi17-mesh-map-channel1">
<float_array id="c_cq_xiangzi17-mesh-map-channel1-array" count="72">1 0 0 0 0 0 1 1 0 0 1 0 0 0 0 1 0 0 0 1 0 1 1 0 0 0 0 1 0 0 0 1 0 1 1 0 0 0 0 1 0 0 0 1 0 1 1 0 0 0 0 1 0 0 0 1 0 1 1 0 0 0 0 1 0 0 0 1 0 1 1 0</float_array>
<technique_common>
<accessor source="#c_cq_xiangzi17-mesh-map-channel1-array" count="24" stride="3">
<param name="S" type="float"/>
<param name="T" type="float"/>
<param name="P" type="float"/>
</accessor>
</technique_common>
</source>
<source id="c_cq_xiangzi17-mesh-map-channel1-tangents">
<float_array id="c_cq_xiangzi17-mesh-map-channel1-tangents-array" count="12">-0.001135 0.999999 0 0.001135 -0.999999 0 0.999999 0.001135 0 -0.999999 -0.001135 0</float_array>
<technique_common>
<accessor source="#c_cq_xiangzi17-mesh-map-channel1-tangents-array" count="4" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="c_cq_xiangzi17-mesh-map-channel1-binormals">
<float_array id="c_cq_xiangzi17-mesh-map-channel1-binormals-array" count="6">0.999999 0.001135 0 0 0 -1</float_array>
<technique_common>
<accessor source="#c_cq_xiangzi17-mesh-map-channel1-binormals-array" count="2" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="c_cq_xiangzi17-mesh-vertices">
<input semantic="POSITION" source="#c_cq_xiangzi17-mesh-positions"/>
</vertices>
<triangles material="c_cq_xiangzi01" count="12">
<input semantic="VERTEX" source="#c_cq_xiangzi17-mesh-vertices" offset="0"/>
<input semantic="NORMAL" source="#c_cq_xiangzi17-mesh-normals" offset="1"/>
<input semantic="TEXCOORD" source="#c_cq_xiangzi17-mesh-map-channel1" offset="2" set="1"/>
<input semantic="TEXTANGENT" source="#c_cq_xiangzi17-mesh-map-channel1-tangents" offset="3" set="1"/>
<input semantic="TEXBINORMAL" source="#c_cq_xiangzi17-mesh-map-channel1-binormals" offset="4" set="1"/>
<p>0 0 0 0 0 2 1 2 0 0 3 2 3 0 0 3 2 3 0 0 1 3 1 0 0 0 0 0 0 0 4 4 4 1 0 5 5 5 1 0 7 6 7 1 0 7 6 7 1 0 6 7 6 1 0 4 4 4 1 0 0 8 8 1 1 1 9 9 1 1 5 10 11 1 1 5 10 11 1 1 4 11 10 1 1 0 8 8 1 1 1 12 12 2 1 3 13 13 2 1 7 14 15 2 1 7 14 15 2 1 5 15 14 2 1 1 12 12 2 1 3 16 16 0 1 2 17 17 0 1 6 18 19 0 1 6 18 19 0 1 7 19 18 0 1 3 16 16 0 1 2 20 20 3 1 0 21 21 3 1 4 22 23 3 1 4 22 23 3 1 6 23 22 3 1 2 20 20 3 1</p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_visual_scenes>
<visual_scene id="Untitled.max" name="Untitled_max">
<node id="c_cq_xiangzi17-node" name="c_cq_xiangzi17" type="NODE">
<matrix>1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1</matrix>
<instance_geometry url="#c_cq_xiangzi17-mesh">
<bind_material>
<technique_common>
<instance_material symbol="c_cq_xiangzi01" target="#c_cq_xiangzi01">
<bind_vertex_input semantic="CHANNEL1" input_semantic="TEXCOORD" input_set="1"/>
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
</node>
<extra>
<technique profile="FCOLLADA">
<start_time>0</start_time>
<end_time>3.33333</end_time>
</technique>
</extra>
<extra>
<technique profile="MAX3D">
<frame_rate>30</frame_rate>
</technique>
</extra>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#Untitled.max"/>
</scene>
</COLLADA>

0 comments on commit c637fa1

Please sign in to comment.