public void FLIP(object[] args)
{
// override physics rigging
foreach (object arg in args) {
if (arg is GameObject) {
(arg as GameObject).GetComponent<Rigging> ().ActivatePhysics(false);
}
}
Vector3 targetRotation = Vector3.zero;
Helper.PrintRDFTriples (rdfTriples);
if (args [0] is GameObject) {
GameObject obj = args [0] as GameObject;
Vector3 rotation = obj.transform.eulerAngles;
float targetX = (rotation.x >= 360.0f) ? rotation.x - 360.0f : rotation.x;
float targetY = (rotation.y+180.0f >= 360.0f) ? rotation.y+180.0f - 360.0f : rotation.y+180.0f;
float targetZ = (rotation.z+180.0f >= 360.0f) ? rotation.z+180.0f - 360.0f : rotation.z+180.0f;
//targetX = (rotation.x < 0.0f) ? rotation.x + 360.0f : rotation.x;
//targetY = (rotation.y+180.0f < 0.0f) ? rotation.y+180.0f + 360.0f : rotation.y+180.0f;
//targetZ = (rotation.z+180.0f < 0.0f) ? rotation.z+180.0f + 360.0f : rotation.z+180.0f;
targetRotation = new Vector3 (targetX,targetY,targetZ);
Voxeme voxComponent = obj.GetComponent<Voxeme> ();
if (voxComponent != null) {
if (!voxComponent.enabled) {
voxComponent.gameObject.transform.parent = null;
voxComponent.enabled = true;
}
voxComponent.targetRotation = targetRotation;
}
}
// add to events manager
if (args[args.Length-1] is bool) {
if ((bool)args[args.Length-1] == false) {
//eventManager.eventsStatus.Add ("flip("+(args [0] as GameObject).name+","+Helper.VectorToParsable(targetRotation)+")", false);
eventManager.events[0] = "flip("+(args [0] as GameObject).name+","+Helper.VectorToParsable(targetRotation)+")";
}
}
return;
}