本文整理了Java中com.jme3.scene.shape.Box.setBuffer()
方法的一些代码示例,展示了Box.setBuffer()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Box.setBuffer()
方法的具体详情如下:
包路径:com.jme3.scene.shape.Box
类名称:Box
方法名:setBuffer
暂无
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
@Override
public void onAction(String name, boolean isPressed, float tpf) {
if (name.equals("change") && isPressed) {
box.setBuffer(VertexBuffer.Type.MorphTarget0, 3, target2.getBuffer(VertexBuffer.Type.Position));
}
}
}, "change");
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
protected void doUpdateGeometryIndices() {
if (getBuffer(Type.Index) == null){
setBuffer(Type.Index, 3, BufferUtils.createShortBuffer(GEOMETRY_INDICES_DATA));
}
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
protected void doUpdateGeometryNormals() {
if (getBuffer(Type.Normal) == null){
setBuffer(Type.Normal, 3, BufferUtils.createFloatBuffer(GEOMETRY_NORMALS_DATA));
}
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
protected void doUpdateGeometryTextures() {
if (getBuffer(Type.TexCoord) == null){
setBuffer(Type.TexCoord, 2, BufferUtils.createFloatBuffer(GEOMETRY_TEXTURE_DATA));
}
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
protected void doUpdateGeometryVertices() {
FloatBuffer fpb = BufferUtils.createVector3Buffer(24);
Vector3f[] v = computeVertices();
fpb.put(new float[] {
v[0].x, v[0].y, v[0].z, v[1].x, v[1].y, v[1].z, v[2].x, v[2].y, v[2].z, v[3].x, v[3].y, v[3].z, // back
v[1].x, v[1].y, v[1].z, v[4].x, v[4].y, v[4].z, v[6].x, v[6].y, v[6].z, v[2].x, v[2].y, v[2].z, // right
v[4].x, v[4].y, v[4].z, v[5].x, v[5].y, v[5].z, v[7].x, v[7].y, v[7].z, v[6].x, v[6].y, v[6].z, // front
v[5].x, v[5].y, v[5].z, v[0].x, v[0].y, v[0].z, v[3].x, v[3].y, v[3].z, v[7].x, v[7].y, v[7].z, // left
v[2].x, v[2].y, v[2].z, v[6].x, v[6].y, v[6].z, v[7].x, v[7].y, v[7].z, v[3].x, v[3].y, v[3].z, // top
v[0].x, v[0].y, v[0].z, v[5].x, v[5].y, v[5].z, v[4].x, v[4].y, v[4].z, v[1].x, v[1].y, v[1].z // bottom
});
setBuffer(Type.Position, 3, fpb);
updateBound();
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
indicesHW.setUsage(Usage.CpuOnly);
weightsHW.setUsage(Usage.CpuOnly);
box.setBuffer(weightsHW);
box.setBuffer(indicesHW);
VertexBuffer weightsBuf = new VertexBuffer(Type.BoneWeight);
weightsBuf.setupData(Usage.CpuOnly, 4, Format.Float, weights);
box.setBuffer(weightsBuf);
VertexBuffer indicesBuf = new VertexBuffer(Type.BoneIndex);
indicesBuf.setupData(Usage.CpuOnly, 4, Format.UnsignedByte, indices);
box.setBuffer(indicesBuf);
代码示例来源:origin: info.projectkyoto/mms-engine
protected void duUpdateGeometryTextures() {
if (getBuffer(Type.TexCoord) == null){
setBuffer(Type.TexCoord, 2, BufferUtils.createFloatBuffer(GEOMETRY_TEXTURE_DATA));
}
}
代码示例来源:origin: org.jmonkeyengine/jme3-core
protected void duUpdateGeometryTextures() {
if (getBuffer(Type.TexCoord) == null){
setBuffer(Type.TexCoord, 2, BufferUtils.createFloatBuffer(GEOMETRY_TEXTURE_DATA));
}
}
代码示例来源:origin: org.jmonkeyengine/jme3-core
protected void duUpdateGeometryNormals() {
if (getBuffer(Type.Normal) == null){
setBuffer(Type.Normal, 3, BufferUtils.createFloatBuffer(GEOMETRY_NORMALS_DATA));
}
}
代码示例来源:origin: org.jmonkeyengine/jme3-core
protected void duUpdateGeometryIndices() {
if (getBuffer(Type.Index) == null){
setBuffer(Type.Index, 3, BufferUtils.createShortBuffer(GEOMETRY_INDICES_DATA));
}
}
代码示例来源:origin: info.projectkyoto/mms-engine
protected void duUpdateGeometryIndices() {
if (getBuffer(Type.Index) == null){
setBuffer(Type.Index, 3, BufferUtils.createShortBuffer(GEOMETRY_INDICES_DATA));
}
}
代码示例来源:origin: info.projectkyoto/mms-engine
protected void duUpdateGeometryNormals() {
if (getBuffer(Type.Normal) == null){
setBuffer(Type.Normal, 3, BufferUtils.createFloatBuffer(GEOMETRY_NORMALS_DATA));
}
}
代码示例来源:origin: info.projectkyoto/mms-engine
protected void duUpdateGeometryVertices() {
FloatBuffer fpb = BufferUtils.createVector3Buffer(24);
Vector3f[] v = computeVertices();
fpb.put(new float[] {
v[0].x, v[0].y, v[0].z, v[1].x, v[1].y, v[1].z, v[2].x, v[2].y, v[2].z, v[3].x, v[3].y, v[3].z, // back
v[1].x, v[1].y, v[1].z, v[4].x, v[4].y, v[4].z, v[6].x, v[6].y, v[6].z, v[2].x, v[2].y, v[2].z, // right
v[4].x, v[4].y, v[4].z, v[5].x, v[5].y, v[5].z, v[7].x, v[7].y, v[7].z, v[6].x, v[6].y, v[6].z, // front
v[5].x, v[5].y, v[5].z, v[0].x, v[0].y, v[0].z, v[3].x, v[3].y, v[3].z, v[7].x, v[7].y, v[7].z, // left
v[2].x, v[2].y, v[2].z, v[6].x, v[6].y, v[6].z, v[7].x, v[7].y, v[7].z, v[3].x, v[3].y, v[3].z, // top
v[0].x, v[0].y, v[0].z, v[5].x, v[5].y, v[5].z, v[4].x, v[4].y, v[4].z, v[1].x, v[1].y, v[1].z // bottom
});
setBuffer(Type.Position, 3, fpb);
updateBound();
}
代码示例来源:origin: org.jmonkeyengine/jme3-core
protected void duUpdateGeometryVertices() {
FloatBuffer fpb = BufferUtils.createVector3Buffer(24);
Vector3f[] v = computeVertices();
fpb.put(new float[] {
v[0].x, v[0].y, v[0].z, v[1].x, v[1].y, v[1].z, v[2].x, v[2].y, v[2].z, v[3].x, v[3].y, v[3].z, // back
v[1].x, v[1].y, v[1].z, v[4].x, v[4].y, v[4].z, v[6].x, v[6].y, v[6].z, v[2].x, v[2].y, v[2].z, // right
v[4].x, v[4].y, v[4].z, v[5].x, v[5].y, v[5].z, v[7].x, v[7].y, v[7].z, v[6].x, v[6].y, v[6].z, // front
v[5].x, v[5].y, v[5].z, v[0].x, v[0].y, v[0].z, v[3].x, v[3].y, v[3].z, v[7].x, v[7].y, v[7].z, // left
v[2].x, v[2].y, v[2].z, v[6].x, v[6].y, v[6].z, v[7].x, v[7].y, v[7].z, v[3].x, v[3].y, v[3].z, // top
v[0].x, v[0].y, v[0].z, v[5].x, v[5].y, v[5].z, v[4].x, v[4].y, v[4].z, v[1].x, v[1].y, v[1].z // bottom
});
setBuffer(Type.Position, 3, fpb);
updateBound();
}
内容来源于网络,如有侵权,请联系作者删除!