com.jme3.scene.Mesh.createCollisionData()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(99)

本文整理了Java中com.jme3.scene.Mesh.createCollisionData()方法的一些代码示例,展示了Mesh.createCollisionData()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Mesh.createCollisionData()方法的具体详情如下:
包路径:com.jme3.scene.Mesh
类名称:Mesh
方法名:createCollisionData

Mesh.createCollisionData介绍

[英]Generates a collision tree for the mesh. Called automatically by #collideWith(com.jme3.collision.Collidable,com.jme3.math.Matrix4f,com.jme3.bounding.BoundingVolume,com.jme3.collision.CollisionResults).
[中]为网格生成碰撞树。由#collide with(com.jme3.collization.Collidable、com.jme3.math.Matrix4f、com.jme3.bounding.BoundingVolume、com.jme3.collization.CollisionResults)自动调用。

代码示例

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

/**
 * Handles collision detection, internal use only.
 * User code should only use collideWith() on scene
 * graph elements such as {@link Spatial}s.
 */
public int collideWith(Collidable other,
            Matrix4f worldMatrix,
            BoundingVolume worldBound,
            CollisionResults results){
  switch (mode) {
    case Points:
    case Lines:
    case LineStrip:
    case LineLoop:
      /*
       * Collisions can be detected only with triangles,
       * and there are no triangles in this mesh.
       */
      return 0;
  }
  if (getVertexCount() == 0) {
    return 0;
  }
  if (collisionTree == null){
    createCollisionData();
  }
  return collisionTree.collideWith(other, worldMatrix, worldBound, results);
}

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

terrainBlock.createCollisionData();

代码示例来源:origin: info.projectkyoto/mms-engine

/**
 * Handles collision detection, internal use only.
 * User code should only use collideWith() on scene
 * graph elements such as {@link Spatial}s.
 */
public int collideWith(Collidable other, 
            Matrix4f worldMatrix,
            BoundingVolume worldBound,
            CollisionResults results){
  if (getVertexCount() == 0) {
    return 0;
  }
  
  if (collisionTree == null){
    createCollisionData();
  }
  
  return collisionTree.collideWith(other, worldMatrix, worldBound, results);
}

代码示例来源:origin: org.jmonkeyengine/jme3-core

/**
 * Handles collision detection, internal use only.
 * User code should only use collideWith() on scene
 * graph elements such as {@link Spatial}s.
 */
public int collideWith(Collidable other,
            Matrix4f worldMatrix,
            BoundingVolume worldBound,
            CollisionResults results){
  switch (mode) {
    case Points:
    case Lines:
    case LineStrip:
    case LineLoop:
      /*
       * Collisions can be detected only with triangles,
       * and there are no triangles in this mesh.
       */
      return 0;
  }
  if (getVertexCount() == 0) {
    return 0;
  }
  if (collisionTree == null){
    createCollisionData();
  }
  return collisionTree.collideWith(other, worldMatrix, worldBound, results);
}

代码示例来源:origin: us.ihmc.thirdparty.jme/jme3-terrain

terrainBlock.createCollisionData();

相关文章