Vector Swizzling and Property Access #35

Closed
opened 2023-08-20 02:55:33 +02:00 by kayomn · 0 comments
Owner

Properties of vec2 and vec3 objects in OnaScript cannot yet be accessed from within the context of the VM.

Being primitive objects, they need special handling to support field access unlike dynamic objects. However, that handling will probably be faster, if not constant time, compared to dynamic objects which require dynamic lookup for their fields in all cases.

Swizzling would also be a nice feature, as too often I find myself using other game technologies like Godot where I am writing Vector2(existingVec3.x, existingVec3.z) instead of just existingVec3.xz.

Properties of `vec2` and `vec3` objects in OnaScript cannot yet be accessed from within the context of the VM. Being primitive objects, they need special handling to support field access unlike dynamic objects. However, that handling will probably be faster, if not constant time, compared to dynamic objects which require dynamic lookup for their fields in all cases. Swizzling would also be a nice feature, as too often I find myself using other game technologies like Godot where I am writing `Vector2(existingVec3.x, existingVec3.z)` instead of just `existingVec3.xz`.
kayomn added this to the (deleted) milestone 2023-08-20 02:55:33 +02:00
kayomn self-assigned this 2023-08-20 02:55:34 +02:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: kayomn/ona#35
No description provided.