Oolite 1.91.0.7645-241119-222d325
|
import "OOJSQuaternion.h"
import "OOJavaScriptEngine.h"
import <objc/objc-runtime.h>
import "OOConstToString.h"
import "OOJSEntity.h"
import "OOJSVector.h"
Go to the source code of this file.
Macros | |
#define | COUNT(FIELD) |
Enumerations | |
enum | { kQuaternion_w , kQuaternion_x , kQuaternion_y , kQuaternion_z } |
Functions | |
static BOOL | GetThisQuaternion (JSContext *context, JSObject *quaternionObj, Quaternion *outQuaternion, NSString *method) NONNULL_FUNC |
static JSBool | QuaternionGetProperty (JSContext *context, JSObject *this, jsid propID, jsval *value) |
static JSBool | QuaternionSetProperty (JSContext *context, JSObject *this, jsid propID, JSBool strict, jsval *value) |
static void | QuaternionFinalize (JSContext *context, JSObject *this) |
static JSBool | QuaternionConstruct (JSContext *context, uintN argc, jsval *vp) |
static JSBool | QuaternionToString (JSContext *context, uintN argc, jsval *vp) |
static JSBool | QuaternionToSource (JSContext *context, uintN argc, jsval *vp) |
static JSBool | QuaternionMultiply (JSContext *context, uintN argc, jsval *vp) |
static JSBool | QuaternionDot (JSContext *context, uintN argc, jsval *vp) |
static JSBool | QuaternionRotate (JSContext *context, uintN argc, jsval *vp) |
static JSBool | QuaternionRotateX (JSContext *context, uintN argc, jsval *vp) |
static JSBool | QuaternionRotateY (JSContext *context, uintN argc, jsval *vp) |
static JSBool | QuaternionRotateZ (JSContext *context, uintN argc, jsval *vp) |
static JSBool | QuaternionNormalize (JSContext *context, uintN argc, jsval *vp) |
static JSBool | QuaternionConjugate (JSContext *context, uintN argc, jsval *vp) |
static JSBool | QuaternionVectorForward (JSContext *context, uintN argc, jsval *vp) |
static JSBool | QuaternionVectorUp (JSContext *context, uintN argc, jsval *vp) |
static JSBool | QuaternionVectorRight (JSContext *context, uintN argc, jsval *vp) |
static JSBool | QuaternionToArray (JSContext *context, uintN argc, jsval *vp) |
static JSBool | QuaternionStaticRandom (JSContext *context, uintN argc, jsval *vp) |
void | InitOOJSQuaternion (JSContext *context, JSObject *global) |
JSObject * | JSQuaternionWithQuaternion (JSContext *context, Quaternion quaternion) |
BOOL | QuaternionToJSValue (JSContext *context, Quaternion quaternion, jsval *outValue) |
BOOL | JSValueToQuaternion (JSContext *context, jsval value, Quaternion *outQuaternion) |
BOOL | JSObjectGetQuaternion (JSContext *context, JSObject *quaternionObj, Quaternion *outQuaternion) |
BOOL | JSQuaternionSetQuaternion (JSContext *context, JSObject *quaternionObj, Quaternion quaternion) |
static BOOL | QuaternionFromArgumentListNoErrorInternal (JSContext *context, uintN argc, jsval *argv, Quaternion *outQuaternion, uintN *outConsumed, BOOL permitNumberList) |
BOOL | QuaternionFromArgumentList (JSContext *context, NSString *scriptClass, NSString *function, uintN argc, jsval *argv, Quaternion *outQuaternion, uintN *outConsumed) |
BOOL | QuaternionFromArgumentListNoError (JSContext *context, uintN argc, jsval *argv, Quaternion *outQuaternion, uintN *outConsumed) |
Variables | |
static JSObject * | sQuaternionPrototype |
static JSClass | sQuaternionClass |
static JSPropertySpec | sQuaternionProperties [] |
static JSFunctionSpec | sQuaternionMethods [] |
static JSFunctionSpec | sQuaternionStaticMethods [] |
#define COUNT | ( | FIELD | ) |
Definition at line 252 of file OOJSQuaternion.m.
Referenced by JSObjectGetQuaternion(), and JSObjectGetVector().
anonymous enum |
Enumerator | |
---|---|
kQuaternion_w | |
kQuaternion_x | |
kQuaternion_y | |
kQuaternion_z |
Definition at line 87 of file OOJSQuaternion.m.
|
static |
Definition at line 341 of file OOJSQuaternion.m.
References EXPECT, JSObjectGetQuaternion(), and OOJSReportBadArguments().
Referenced by QuaternionConjugate(), QuaternionDot(), QuaternionMultiply(), QuaternionNormalize(), QuaternionRotate(), QuaternionRotateX(), QuaternionRotateY(), QuaternionRotateZ(), QuaternionToArray(), QuaternionToSource(), QuaternionToString(), QuaternionVectorForward(), QuaternionVectorRight(), and QuaternionVectorUp().
void InitOOJSQuaternion | ( | JSContext * | context, |
JSObject * | global ) |
Definition at line 139 of file OOJSQuaternion.m.
References QuaternionConstruct(), sQuaternionClass, sQuaternionMethods, sQuaternionProperties, sQuaternionPrototype, and sQuaternionStaticMethods.
BOOL JSObjectGetQuaternion | ( | JSContext * | context, |
JSObject * | quaternionObj, | ||
Quaternion * | outQuaternion ) |
Definition at line 257 of file OOJSQuaternion.m.
References COUNT, EXPECT, EXPECT_NOT, JSEntityClass(), kZeroQuaternion, OOJS_PROFILE_ENTER, OOJS_PROFILE_EXIT, OOJSIsMemberOfSubclass(), Entity::orientation, and sQuaternionClass.
Referenced by JSValueToQuaternion().
BOOL JSQuaternionSetQuaternion | ( | JSContext * | context, |
JSObject * | quaternionObj, | ||
Quaternion | quaternion ) |
Definition at line 351 of file OOJSQuaternion.m.
References OOJS_PROFILE_ENTER, OOJS_PROFILE_EXIT, and sQuaternionClass.
Referenced by QuaternionSetProperty().
JSObject * JSQuaternionWithQuaternion | ( | JSContext * | context, |
Quaternion | quaternion ) |
Definition at line 145 of file OOJSQuaternion.m.
References EXPECT_NOT, OOJS_PROFILE_ENTER, OOJS_PROFILE_EXIT, sQuaternionClass, and sQuaternionPrototype.
Referenced by OOJSCallObjCObjectMethod(), and QuaternionToJSValue().
BOOL JSValueToQuaternion | ( | JSContext * | context, |
jsval | value, | ||
Quaternion * | outQuaternion ) |
Definition at line 189 of file OOJSQuaternion.m.
References EXPECT_NOT, and JSObjectGetQuaternion().
Referenced by EntitySetProperty(), OOPlanetEntity(OOJavaScriptExtensions)::getJSClass:andPrototype:, OOWaypointEntity(OOJavaScriptExtensions)::getJSClass:andPrototype:, PlayerShipSetCustomView(), ShipSetProperty(), and SystemSetWaypoint().
|
static |
Definition at line 752 of file OOJSQuaternion.m.
References EXPECT_NOT, GetThisQuaternion(), OOJS_PROFILE_ENTER, OOJS_PROFILE_EXIT, OOJS_RETURN_QUATERNION, and OOJS_THIS.
|
static |
Definition at line 539 of file OOJSQuaternion.m.
References EXPECT_NOT, kIdentityQuaternion, OOJS_ARGV, OOJS_PROFILE_ENTER, OOJS_PROFILE_EXIT, OOJS_RETURN_JSOBJECT, OOJSReportBadArguments(), QuaternionFromArgumentListNoErrorInternal(), and sQuaternionClass.
Referenced by InitOOJSQuaternion().
|
static |
Definition at line 631 of file OOJSQuaternion.m.
References EXPECT_NOT, GetThisQuaternion(), OOJS_ARGV, OOJS_PROFILE_ENTER, OOJS_PROFILE_EXIT, OOJS_RETURN_DOUBLE, OOJS_THIS, and QuaternionFromArgumentList().
|
static |
Definition at line 527 of file OOJSQuaternion.m.
References sQuaternionClass.
BOOL QuaternionFromArgumentList | ( | JSContext * | context, |
NSString * | scriptClass, | ||
NSString * | function, | ||
uintN | argc, | ||
jsval * | argv, | ||
Quaternion * | outQuaternion, | ||
uintN * | outConsumed ) |
Definition at line 421 of file OOJSQuaternion.m.
References OOJSReportBadArguments(), and QuaternionFromArgumentListNoErrorInternal().
BOOL QuaternionFromArgumentListNoError | ( | JSContext * | context, |
uintN | argc, | ||
jsval * | argv, | ||
Quaternion * | outQuaternion, | ||
uintN * | outConsumed ) |
Definition at line 434 of file OOJSQuaternion.m.
References QuaternionFromArgumentListNoErrorInternal().
|
static |
Definition at line 378 of file OOJSQuaternion.m.
References EXPECT_NOT, JSObjectGetQuaternion(), OOJS_PROFILE_ENTER, OOJS_PROFILE_EXIT, x, and y.
Referenced by QuaternionConstruct(), QuaternionFromArgumentList(), and QuaternionFromArgumentListNoError().
|
static |
Definition at line 442 of file OOJSQuaternion.m.
References EXPECT_NOT, JSObjectGetQuaternion(), kQuaternion_w, kQuaternion_x, kQuaternion_y, kQuaternion_z, OOJS_PROFILE_ENTER, OOJS_PROFILE_EXIT, OOJSReportBadPropertySelector(), and sQuaternionProperties.
|
static |
Definition at line 613 of file OOJSQuaternion.m.
References EXPECT_NOT, GetThisQuaternion(), OOJS_ARGV, OOJS_PROFILE_ENTER, OOJS_PROFILE_EXIT, OOJS_RETURN_QUATERNION, OOJS_THIS, quaternion_multiply(), and QuaternionFromArgumentList().
|
static |
Definition at line 735 of file OOJSQuaternion.m.
References EXPECT_NOT, GetThisQuaternion(), OOJS_PROFILE_ENTER, OOJS_PROFILE_EXIT, OOJS_RETURN_QUATERNION, and OOJS_THIS.
|
static |
Definition at line 650 of file OOJSQuaternion.m.
References EXPECT_NOT, GetThisQuaternion(), OOJS_ARGV, OOJS_PROFILE_ENTER, OOJS_PROFILE_EXIT, OOJS_RETURN_QUATERNION, OOJS_THIS, OOJSArgumentListGetNumber(), quaternion_rotate_about_axis(), and VectorFromArgumentList().
|
static |
Definition at line 678 of file OOJSQuaternion.m.
References EXPECT_NOT, GetThisQuaternion(), OOJS_ARGV, OOJS_PROFILE_ENTER, OOJS_PROFILE_EXIT, OOJS_RETURN_QUATERNION, OOJS_THIS, OOJSArgumentListGetNumber(), and quaternion_rotate_about_x().
|
static |
Definition at line 697 of file OOJSQuaternion.m.
References EXPECT_NOT, GetThisQuaternion(), OOJS_ARGV, OOJS_PROFILE_ENTER, OOJS_PROFILE_EXIT, OOJS_RETURN_QUATERNION, OOJS_THIS, OOJSArgumentListGetNumber(), and quaternion_rotate_about_y().
|
static |
Definition at line 716 of file OOJSQuaternion.m.
References EXPECT_NOT, GetThisQuaternion(), OOJS_ARGV, OOJS_PROFILE_ENTER, OOJS_PROFILE_EXIT, OOJS_RETURN_QUATERNION, OOJS_THIS, OOJSArgumentListGetNumber(), and quaternion_rotate_about_z().
|
static |
Definition at line 482 of file OOJSQuaternion.m.
References EXPECT_NOT, JSObjectGetQuaternion(), JSQuaternionSetQuaternion(), kQuaternion_w, kQuaternion_x, kQuaternion_y, kQuaternion_z, OOJS_PROFILE_ENTER, OOJS_PROFILE_EXIT, OOJSReportBadPropertySelector(), OOJSReportBadPropertyValue(), and sQuaternionProperties.
|
static |
Definition at line 860 of file OOJSQuaternion.m.
References OOJS_PROFILE_ENTER, OOJS_PROFILE_EXIT, and OOJS_RETURN_QUATERNION.
|
static |
Definition at line 823 of file OOJSQuaternion.m.
References EXPECT_NOT, GetThisQuaternion(), OOJS_PROFILE_ENTER, OOJS_PROFILE_EXIT, OOJS_SET_RVAL, and OOJS_THIS.
BOOL QuaternionToJSValue | ( | JSContext * | context, |
Quaternion | quaternion, | ||
jsval * | outValue ) |
Definition at line 171 of file OOJSQuaternion.m.
References EXPECT_NOT, JSQuaternionWithQuaternion(), OOJS_PROFILE_ENTER, and OOJS_PROFILE_EXIT.
Referenced by EntityGetProperty(), PlanetGetProperty(), ShipGetProperty(), and WaypointGetProperty().
|
static |
Definition at line 597 of file OOJSQuaternion.m.
References EXPECT_NOT, GetThisQuaternion(), OOJS_NATIVE_ENTER, OOJS_NATIVE_EXIT, OOJS_RETURN_OBJECT, and OOJS_THIS.
|
static |
Definition at line 582 of file OOJSQuaternion.m.
References EXPECT_NOT, GetThisQuaternion(), OOJS_NATIVE_ENTER, OOJS_NATIVE_EXIT, OOJS_RETURN_OBJECT, and OOJS_THIS.
|
static |
Definition at line 769 of file OOJSQuaternion.m.
References EXPECT_NOT, GetThisQuaternion(), OOJS_PROFILE_ENTER, OOJS_PROFILE_EXIT, OOJS_RETURN_VECTOR, OOJS_THIS, and vector_forward_from_quaternion().
|
static |
Definition at line 805 of file OOJSQuaternion.m.
References EXPECT_NOT, GetThisQuaternion(), OOJS_PROFILE_ENTER, OOJS_PROFILE_EXIT, OOJS_RETURN_VECTOR, OOJS_THIS, and vector_right_from_quaternion().
|
static |
Definition at line 787 of file OOJSQuaternion.m.
References EXPECT_NOT, GetThisQuaternion(), OOJS_PROFILE_ENTER, OOJS_PROFILE_EXIT, OOJS_RETURN_VECTOR, OOJS_THIS, and vector_up_from_quaternion().
|
static |
Definition at line 70 of file OOJSQuaternion.m.
Referenced by InitOOJSQuaternion(), JSObjectGetQuaternion(), JSQuaternionSetQuaternion(), JSQuaternionWithQuaternion(), QuaternionConstruct(), and QuaternionFinalize().
|
static |
Definition at line 108 of file OOJSQuaternion.m.
Referenced by InitOOJSQuaternion().
|
static |
Definition at line 97 of file OOJSQuaternion.m.
Referenced by InitOOJSQuaternion(), QuaternionGetProperty(), and QuaternionSetProperty().
|
static |
Definition at line 39 of file OOJSQuaternion.m.
Referenced by InitOOJSQuaternion(), and JSQuaternionWithQuaternion().
|
static |
Definition at line 129 of file OOJSQuaternion.m.
Referenced by InitOOJSQuaternion().