本文整理汇总了Java中com.jme3.math.Vector3f.clone方法的典型用法代码示例。如果您正苦于以下问题:Java Vector3f.clone方法的具体用法?Java Vector3f.clone怎么用?Java Vector3f.clone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jme3.math.Vector3f
的用法示例。
在下文中一共展示了Vector3f.clone方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: extractBoneTrack
import com.jme3.math.Vector3f; //导入方法依赖的package包/类
/**
* Extract a bone track from a source animation to sub animation.
*
* @param boneTrack the source bone track.
* @param startFrame the start frame.
* @param endFrame the end frame.
* @return the extracted bone track.
*/
@NotNull
private static BoneTrack extractBoneTrack(@NotNull final BoneTrack boneTrack, final int startFrame,
final int endFrame) {
final float[] sourceTimes = boneTrack.getTimes();
final Vector3f[] newTranslations = new Vector3f[endFrame - startFrame];
final Quaternion[] newRotations = new Quaternion[endFrame - startFrame];
final Vector3f[] newScales = new Vector3f[endFrame - startFrame];
final float[] newTimes = new float[endFrame - startFrame];
for (int i = startFrame; i < endFrame; i++) {
final int newFrame = i - startFrame;
final Vector3f sourceTranslation = boneTrack.getTranslations()[i];
final Vector3f sourceScale = boneTrack.getScales()[i];
final Quaternion sourceRotation = boneTrack.getRotations()[i];
newTimes[newFrame] = sourceTimes[i] - sourceTimes[startFrame];
newTranslations[newFrame] = sourceTranslation.clone();
newRotations[newFrame] = sourceRotation.clone();
newScales[newFrame] = sourceScale.clone();
}
return new BoneTrack(boneTrack.getTargetBoneIndex(), newTimes, newTranslations, newRotations, newScales);
}
示例2: setPropertyValue
import com.jme3.math.Vector3f; //导入方法依赖的package包/类
@Override
@FXThread
protected void setPropertyValue(@Nullable final Vector3f vector) {
super.setPropertyValue(vector == null ? null : vector.clone());
}