use of com.badlogic.gdx.math.Vector3 in project nhglib by VoidZombie.
the class NodeComponent method getScaleDelta.
public Vector3 getScaleDelta() {
Vector3 res = temp.set(scaleDelta);
scaleDelta.set(Vector3.Zero);
return res;
}
use of com.badlogic.gdx.math.Vector3 in project nhglib by VoidZombie.
the class NodeComponent method getRotationDelta.
public Vector3 getRotationDelta() {
Vector3 res = temp.set(rotationDelta);
rotationDelta.set(Vector3.Zero);
return res;
}
use of com.badlogic.gdx.math.Vector3 in project nhglib by VoidZombie.
the class PhysicsSystem method process.
@Override
protected void process(int entityId) {
NodeComponent nodeComponent = nodeMapper.get(entityId);
RigidBodyComponent bodyComponent = rigidBodyMapper.get(entityId);
if (!bodyComponent.isAdded()) {
Matrix4 initialTransform = new Matrix4();
Vector3 trn = nodeComponent.getTranslation();
Vector3 scl = new Vector3(1, 1, 1);
Quaternion rtn = nodeComponent.getRotationQuaternion();
initialTransform.set(trn, rtn, scl);
bodyComponent.addToWorld(dynamicsWorld, initialTransform);
} else {
nodeComponent.setTranslation(bodyComponent.getTranslation());
nodeComponent.setRotation(bodyComponent.getRotation());
nodeComponent.applyTransforms();
}
}
use of com.badlogic.gdx.math.Vector3 in project Entitas-Java by Rubentxu.
the class InputManagerGDX method touchUp.
@Override
public boolean touchUp(int screenX, int screenY, int pointer, int button) {
int indexPointer = (mouse) ? button : pointer;
//set the state of all touch state events
if (indexPointer < inputStateData.pointerStates.length) {
PointerState<Vector2, Vector3> t = inputStateData.pointerStates[indexPointer];
t.worldCoordinates.set(screenX, screenY, 0);
camera.unproject(t.worldCoordinates);
t.down = false;
t.released = true;
t.clickTime = 0;
t.coordinates.x = t.worldCoordinates.x;
t.coordinates.y = t.worldCoordinates.y;
if (joints[indexPointer] != null) {
physics.destroyJoint(joints[indexPointer]);
joints[indexPointer] = null;
}
}
return false;
}
use of com.badlogic.gdx.math.Vector3 in project Entitas-Java by Rubentxu.
the class InputManagerGDX method touchDown.
@Override
public boolean touchDown(int screenX, int screenY, int pointer, int button) {
int indexPointer = (mouse) ? button : pointer;
//set the state of all touch state events
if (indexPointer < inputStateData.pointerStates.length) {
PointerState<Vector2, Vector3> t = inputStateData.pointerStates[indexPointer];
t.down = true;
t.pressed = true;
//recording last position for displacement values
t.lastPosition.x = t.coordinates.x;
t.lastPosition.y = t.coordinates.y;
t.worldCoordinates.set(screenX, screenY, 0);
camera.unproject(t.worldCoordinates);
//store the coordinates of this touch event
t.coordinates.x = t.worldCoordinates.x;
t.coordinates.y = t.worldCoordinates.y;
physics.QueryAABB(queryCallback, t.coordinates.x, t.coordinates.y, t.coordinates.x, t.coordinates.y);
}
return false;
}
Aggregations