Last active
August 29, 2015 14:08
-
-
Save cecilemuller/323e7bac2e26c8b13098 to your computer and use it in GitHub Desktop.
Convert an SFRotation orientation to an SFVec3f direction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#VRML V2.0 utf8 | |
# | |
# Convert an SFRotation orientation to an SFVec3f direction | |
# | |
PROTO OrientationToDirection [ | |
eventIn SFRotation set_orientation | |
eventOut SFVec3f direction_changed | |
]{ | |
Script { | |
field SFVec3f forward 0 0 -1 | |
eventIn SFRotation set_orientation IS set_orientation | |
eventOut SFVec3f direction_changed IS direction_changed | |
directOutput TRUE | |
url "javascript: | |
function set_orientation(value){ | |
direction_changed = value.multVec(forward); | |
} | |
" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment