Package com.ardor3d.util.geom

Examples of com.ardor3d.util.geom.VertMap


        }
        final MeshVertPairs mvp = new MeshVertPairs(points, indices);
        _dataCache.getVertMappings().put(colladaGeometry, mvp);

        if (_optimizeMeshes) {
            final VertMap map = GeometryTool.minimizeVerts(points, _optimizeSettings);
            _dataCache.setMeshVertMap(points, map);
        }

        // Update bound
        points.updateModelBound();
View Full Code Here


            }
            firstIndex += vals.length / interval;
        }

        if (_optimizeMeshes) {
            final VertMap map = GeometryTool.minimizeVerts(polyMesh, _optimizeSettings);
            _dataCache.setMeshVertMap(polyMesh, map);
        }

        // update bounds
        polyMesh.updateModelBound();
View Full Code Here

            }
            firstIndex += length;
        }

        if (_optimizeMeshes) {
            final VertMap map = GeometryTool.minimizeVerts(polyMesh, _optimizeSettings);
            _dataCache.setMeshVertMap(polyMesh, map);
        }

        // update bounds
        polyMesh.updateModelBound();
View Full Code Here

                indices[j] = rVal;
            }
        }

        if (_optimizeMeshes) {
            final VertMap map = GeometryTool.minimizeVerts(triMesh, _optimizeSettings);
            _dataCache.setMeshVertMap(triMesh, map);
        }

        triMesh.updateModelBound();
View Full Code Here

                indices[j] = rVal;
            }
        }

        if (_optimizeMeshes) {
            final VertMap map = GeometryTool.minimizeVerts(lineMesh, _optimizeSettings);
            _dataCache.setMeshVertMap(lineMesh, map);
        }

        lineMesh.updateModelBound();
View Full Code Here

                    if (pairsMap == null) {
                        throw new ColladaException("Unable to locate pair map for geometry.", geometry);
                    }

                    // Check for a remapping, if we optimized geometry
                    final VertMap vertMap = _dataCache.getMeshVertMap().get(sourceMesh);

                    // Use pairs map and vertWeightMap to build our weights and joint indices.
                    {
                        // count number of weights used
                        int maxWeightsPerVert = 0;
                        int weightCount;
                        for (final int originalIndex : pairsMap.getIndices()) {
                            weightCount = 0;

                            // get weights and joints at original index and add weights up to get divisor sum
                            // we'll assume 0's for vertices with no matching weight.
                            if (vertWeightMap.length > originalIndex) {
                                final int[] data = vertWeightMap[originalIndex];
                                for (int i = 0; i < data.length; i += maxOffset + 1) {
                                    final float weight = jointWeights.get(data[i + weightOff]);
                                    if (weight != 0) {
                                        weightCount++;
                                    }
                                }
                                if (weightCount > maxWeightsPerVert) {
                                    maxWeightsPerVert = weightCount;
                                }
                            }
                        }

                        final int verts = skMesh.getMeshData().getVertexCount();
                        final FloatBuffer weightBuffer = BufferUtils.createFloatBuffer(verts * maxWeightsPerVert);
                        final ShortBuffer jointIndexBuffer = BufferUtils.createShortBuffer(verts * maxWeightsPerVert);
                        int j;
                        float sum = 0;
                        final float[] weights = new float[maxWeightsPerVert];
                        final short[] indices = new short[maxWeightsPerVert];
                        int originalIndex;
                        for (int x = 0; x < verts; x++) {
                            if (vertMap != null) {
                                originalIndex = pairsMap.getIndices()[vertMap.getFirstOldIndex(x)];
                            } else {
                                originalIndex = pairsMap.getIndices()[x];
                            }

                            j = 0;
View Full Code Here

TOP

Related Classes of com.ardor3d.util.geom.VertMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.