本文整理汇总了Java中com.vuforia.Matrix44F.setData方法的典型用法代码示例。如果您正苦于以下问题:Java Matrix44F.setData方法的具体用法?Java Matrix44F.setData怎么用?Java Matrix44F.setData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vuforia.Matrix44F
的用法示例。
在下文中一共展示了Matrix44F.setData方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Matrix44FIdentity
import com.vuforia.Matrix44F; //导入方法依赖的package包/类
public static Matrix44F Matrix44FIdentity()
{
Matrix44F r = new Matrix44F();
for (int i = 0; i < 16; i++)
temp[i] = 0.0f;
temp[0] = 1.0f;
temp[5] = 1.0f;
temp[10] = 1.0f;
temp[15] = 1.0f;
r.setData(temp);
return r;
}
示例2: Matrix44FIdentity
import com.vuforia.Matrix44F; //导入方法依赖的package包/类
public static Matrix44F Matrix44FIdentity()
{
Matrix44F r = new Matrix44F();
for (int i = 0; i < 16; i++)
temp[i] = 0.0f;
temp[0] = 1.0f;
temp[5] = 1.0f;
temp[10] = 1.0f;
temp[15] = 1.0f;
r.setData(temp);
return r;
}
示例3: Matrix44FTranspose
import com.vuforia.Matrix44F; //导入方法依赖的package包/类
public static Matrix44F Matrix44FTranspose(Matrix44F m)
{
Matrix44F r = new Matrix44F();
for (int i = 0; i < 4; i++)
for (int j = 0; j < 4; j++)
temp[i * 4 + j] = m.getData()[i + 4 * j];
r.setData(temp);
return r;
}
示例4: Matrix44FTranspose
import com.vuforia.Matrix44F; //导入方法依赖的package包/类
public static Matrix44F Matrix44FTranspose(Matrix44F m)
{
Matrix44F r = new Matrix44F();
for (int i = 0; i < 4; i++)
for (int j = 0; j < 4; j++)
temp[i * 4 + j] = m.getData()[i + 4 * j];
r.setData(temp);
return r;
}
示例5: setProjectionAndCamera
import com.vuforia.Matrix44F; //导入方法依赖的package包/类
private void setProjectionAndCamera(Display contentProvider, TrackableResult[] trackables, float filedOfView) {
ModelInstance model = contentProvider.modelInstance;
if (trackables != null && trackables.length > 0) {
//transform all content
TrackableResult trackable = trackables[0];
Matrix44F modelViewMatrix = Tool.convertPose2GLMatrix(trackable.getPose());
float[] raw = modelViewMatrix.getData();
float[] rotated;
//switch axis and rotate to compensate coordinates change
if (com.vuforia.Renderer.getInstance().getVideoBackgroundConfig().getReflection() == VIDEO_BACKGROUND_REFLECTION.VIDEO_BACKGROUND_REFLECTION_ON) {
// Front camera
rotated = new float[]{
raw[1], raw[0], raw[2], raw[3],
raw[5], raw[4], raw[6], raw[7],
raw[9], raw[8], raw[10], raw[11],
raw[13], raw[12], raw[14], raw[15]
};
} else {
// Back camera
rotated = new float[]{
raw[1], -raw[0], raw[2], raw[3],
raw[5], -raw[4], raw[6], raw[7],
raw[9], -raw[8], raw[10], raw[11],
raw[13], -raw[12], raw[14], raw[15]
};
}
Matrix44F rot = new Matrix44F();
rot.setData(rotated);
Matrix44F inverse = SampleMath.Matrix44FInverse(rot);
Matrix44F transp = SampleMath.Matrix44FTranspose(inverse);
float[] data = transp.getData();
camera.position.set(data[12], data[13], data[14]);
camera.up.set(data[4], data[5], data[6]);
camera.direction.set(data[8], data[9], data[10]);
//update filed of view
camera.fieldOfView = filedOfView;
} else {
camera.position.set(100, 100, 100);
camera.lookAt(1000,1000,1000);
}
model.transform.set(new Matrix4());
//the model is rotated
model.transform.rotate(1.0F, 0.0F, 0.0F, 90.0F);
model.transform.rotate(0.0F, 1.0F, 0.0F, 90.0F);
model.transform.scale(MODEL_SCALE, MODEL_SCALE, MODEL_SCALE);
camera.update();
}