Implement Vector4, Vector4i, Projection
Implement built-in classes Vector4, Vector4i and Projection. * Two versions of Vector4 (float and integer). * A Projection class, which is a 4x4 matrix specialized in projection types. These types have been requested for a long time, but given they were very corner case they were not added before. Because in Godot 4, reimplementing parts of the rendering engine is now possible, access to these types (heavily used by the rendering code) becomes a necessity. **Q**: Why Projection and not Matrix4? **A**: Godot does not use Matrix2, Matrix3, Matrix4x3, etc. naming convention because, within the engine, these types always have a *purpose*. As such, Godot names them: Transform2D, Transform3D or Basis. In this case, this 4x4 matrix is _always_ used as a _Projection_, hence the naming.
This commit is contained in:
parent
fe929d4787
commit
455c06ecd4
123 changed files with 4139 additions and 594 deletions
|
|
@ -363,8 +363,8 @@ Transform3D WebXRInterfaceJS::get_transform_for_view(uint32_t p_view, const Tran
|
|||
return p_cam_transform * xr_server->get_reference_frame() * transform_for_eye;
|
||||
};
|
||||
|
||||
CameraMatrix WebXRInterfaceJS::get_projection_for_view(uint32_t p_view, double p_aspect, double p_z_near, double p_z_far) {
|
||||
CameraMatrix eye;
|
||||
Projection WebXRInterfaceJS::get_projection_for_view(uint32_t p_view, double p_aspect, double p_z_near, double p_z_far) {
|
||||
Projection eye;
|
||||
|
||||
float *js_matrix = godot_webxr_get_projection_for_eye(p_view + 1);
|
||||
if (!initialized || js_matrix == nullptr) {
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ public:
|
|||
virtual uint32_t get_view_count() override;
|
||||
virtual Transform3D get_camera_transform() override;
|
||||
virtual Transform3D get_transform_for_view(uint32_t p_view, const Transform3D &p_cam_transform) override;
|
||||
virtual CameraMatrix get_projection_for_view(uint32_t p_view, double p_aspect, double p_z_near, double p_z_far) override;
|
||||
virtual Projection get_projection_for_view(uint32_t p_view, double p_aspect, double p_z_near, double p_z_far) override;
|
||||
virtual Vector<BlitToScreen> post_draw_viewport(RID p_render_target, const Rect2 &p_screen_rect) override;
|
||||
|
||||
virtual void process() override;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue