diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-01-11 00:52:51 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-01-11 00:52:51 -0300 |
commit | bc26f905817945300d397696330d1ab04a1af33c (patch) | |
tree | d06338399c8ea410042f6631fb3db3efcc100b05 /scene/3d | |
parent | 710692278d1353aad08bc7bceb655afc1d6c950c (diff) |
Type renames:
Matrix32 -> Transform2D
Matrix3 -> Basis
AABB -> Rect3
RawArray -> PoolByteArray
IntArray -> PoolIntArray
FloatArray -> PoolFloatArray
Vector2Array -> PoolVector2Array
Vector3Array -> PoolVector3Array
ColorArray -> PoolColorArray
Diffstat (limited to 'scene/3d')
34 files changed, 100 insertions, 100 deletions
diff --git a/scene/3d/baked_light_instance.cpp b/scene/3d/baked_light_instance.cpp index 19be12ed91..59d8d7ecac 100644 --- a/scene/3d/baked_light_instance.cpp +++ b/scene/3d/baked_light_instance.cpp @@ -308,7 +308,7 @@ static _FORCE_INLINE_ Vector2 get_uv(const Vector3& p_pos, const Vector3 *p_vtx, return p_uv[0]*u + p_uv[1]*v + p_uv[2]*w; } -void BakedLight::_plot_face(int p_idx, int p_level, const Vector3 *p_vtx, const Vector2* p_uv, const MaterialCache& p_material, const AABB &p_aabb) { +void BakedLight::_plot_face(int p_idx, int p_level, const Vector3 *p_vtx, const Vector2* p_uv, const MaterialCache& p_material, const Rect3 &p_aabb) { @@ -477,7 +477,7 @@ void BakedLight::_plot_face(int p_idx, int p_level, const Vector3 *p_vtx, const //go down for(int i=0;i<8;i++) { - AABB aabb=p_aabb; + Rect3 aabb=p_aabb; aabb.size*=0.5; if (i&1) @@ -488,7 +488,7 @@ void BakedLight::_plot_face(int p_idx, int p_level, const Vector3 *p_vtx, const aabb.pos.z+=aabb.size.z; { - AABB test_aabb=aabb; + Rect3 test_aabb=aabb; //test_aabb.grow_by(test_aabb.get_longest_axis_size()*0.05); //grow a bit to avoid numerical error in real-time Vector3 qsize = test_aabb.size*0.5; //quarter size, for fast aabb test @@ -1534,9 +1534,9 @@ int BakedLight::get_cell_subdiv() const { -AABB BakedLight::get_aabb() const { +Rect3 BakedLight::get_aabb() const { - return AABB(Vector3(0,0,0),Vector3(1,1,1)); + return Rect3(Vector3(0,0,0),Vector3(1,1,1)); } PoolVector<Face3> BakedLight::get_faces(uint32_t p_usage_flags) const { @@ -1549,7 +1549,7 @@ String BakedLight::get_configuration_warning() const { } -void BakedLight::_debug_mesh(int p_idx, int p_level, const AABB &p_aabb,DebugMode p_mode,Ref<MultiMesh> &p_multimesh,int &idx) { +void BakedLight::_debug_mesh(int p_idx, int p_level, const Rect3 &p_aabb,DebugMode p_mode,Ref<MultiMesh> &p_multimesh,int &idx) { if (p_level==cell_subdiv-1) { @@ -1585,7 +1585,7 @@ void BakedLight::_debug_mesh(int p_idx, int p_level, const AABB &p_aabb,DebugMod if (bake_cells_write[p_idx].childs[i]==CHILD_EMPTY) continue; - AABB aabb=p_aabb; + Rect3 aabb=p_aabb; aabb.size*=0.5; if (i&1) diff --git a/scene/3d/baked_light_instance.h b/scene/3d/baked_light_instance.h index 461b3adeff..2fda26ecea 100644 --- a/scene/3d/baked_light_instance.h +++ b/scene/3d/baked_light_instance.h @@ -49,7 +49,7 @@ public: private: RID baked_light; int cell_subdiv; - AABB bounds; + Rect3 bounds; int cells_per_axis; enum { @@ -112,12 +112,12 @@ private: - void _plot_face(int p_idx,int p_level,const Vector3 *p_vtx,const Vector2* p_uv, const MaterialCache& p_material,const AABB& p_aabb); + void _plot_face(int p_idx,int p_level,const Vector3 *p_vtx,const Vector2* p_uv, const MaterialCache& p_material,const Rect3& p_aabb); void _fixup_plot(int p_idx, int p_level, int p_x, int p_y, int p_z); void _bake_add_mesh(const Transform& p_xform,Ref<Mesh>& p_mesh); void _bake_add_to_aabb(const Transform& p_xform,Ref<Mesh>& p_mesh,bool &first); - void _debug_mesh(int p_idx, int p_level, const AABB &p_aabb,DebugMode p_mode,Ref<MultiMesh> &p_multimesh,int &idx); + void _debug_mesh(int p_idx, int p_level, const Rect3 &p_aabb,DebugMode p_mode,Ref<MultiMesh> &p_multimesh,int &idx); void _debug_mesh_albedo(); void _debug_mesh_light(); @@ -156,7 +156,7 @@ public: void create_debug_mesh(DebugMode p_mode); - virtual AABB get_aabb() const; + virtual Rect3 get_aabb() const; virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; String get_configuration_warning() const; diff --git a/scene/3d/collision_polygon.cpp b/scene/3d/collision_polygon.cpp index 6cc0291707..d0612986df 100644 --- a/scene/3d/collision_polygon.cpp +++ b/scene/3d/collision_polygon.cpp @@ -200,7 +200,7 @@ void CollisionPolygon::set_polygon(const Vector<Point2>& p_polygon) { Vector3 p1(polygon[i].x,polygon[i].y,depth*0.5); if (i==0) - aabb=AABB(p1,Vector3()); + aabb=Rect3(p1,Vector3()); else aabb.expand_to(p1); @@ -209,9 +209,9 @@ void CollisionPolygon::set_polygon(const Vector<Point2>& p_polygon) { } - if (aabb==AABB()) { + if (aabb==Rect3()) { - aabb=AABB(Vector3(-1,-1,-1),Vector3(2,2,2)); + aabb=Rect3(Vector3(-1,-1,-1),Vector3(2,2,2)); } else { aabb.pos-=aabb.size*0.3; aabb.size+=aabb.size*0.6; @@ -240,7 +240,7 @@ CollisionPolygon::BuildMode CollisionPolygon::get_build_mode() const{ return build_mode; } -AABB CollisionPolygon::get_item_rect() const { +Rect3 CollisionPolygon::get_item_rect() const { return aabb; } @@ -294,7 +294,7 @@ void CollisionPolygon::_bind_methods() { ADD_PROPERTY( PropertyInfo(Variant::INT,"build_mode",PROPERTY_HINT_ENUM,"Solids,Triangles"),_SCS("set_build_mode"),_SCS("get_build_mode")); ADD_PROPERTY( PropertyInfo(Variant::REAL,"depth"),_SCS("set_depth"),_SCS("get_depth")); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2_ARRAY,"polygon"),_SCS("set_polygon"),_SCS("get_polygon")); + ADD_PROPERTY( PropertyInfo(Variant::POOL_VECTOR2_ARRAY,"polygon"),_SCS("set_polygon"),_SCS("get_polygon")); ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"shape_range",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("_set_shape_range"),_SCS("_get_shape_range")); } @@ -304,7 +304,7 @@ CollisionPolygon::CollisionPolygon() { shape_to=-1; can_update_body=false; - aabb=AABB(Vector3(-1,-1,-1),Vector3(2,2,2)); + aabb=Rect3(Vector3(-1,-1,-1),Vector3(2,2,2)); build_mode=BUILD_SOLIDS; depth=1.0; diff --git a/scene/3d/collision_polygon.h b/scene/3d/collision_polygon.h index 8373832699..693cf0640a 100644 --- a/scene/3d/collision_polygon.h +++ b/scene/3d/collision_polygon.h @@ -48,7 +48,7 @@ protected: float depth; - AABB aabb; + Rect3 aabb; BuildMode build_mode; Vector<Point2> polygon; @@ -78,7 +78,7 @@ public: void set_polygon(const Vector<Point2>& p_polygon); Vector<Point2> get_polygon() const; - virtual AABB get_item_rect() const; + virtual Rect3 get_item_rect() const; int get_collision_object_first_shape() const { return shape_from; } int get_collision_object_last_shape() const { return shape_to; } diff --git a/scene/3d/gi_probe.cpp b/scene/3d/gi_probe.cpp index 438be13394..13e7c175ed 100644 --- a/scene/3d/gi_probe.cpp +++ b/scene/3d/gi_probe.cpp @@ -2,12 +2,12 @@ #include "mesh_instance.h" -void GIProbeData::set_bounds(const AABB& p_bounds) { +void GIProbeData::set_bounds(const Rect3& p_bounds) { VS::get_singleton()->gi_probe_set_bounds(probe,p_bounds); } -AABB GIProbeData::get_bounds() const{ +Rect3 GIProbeData::get_bounds() const{ return VS::get_singleton()->gi_probe_get_bounds(probe); } @@ -127,11 +127,11 @@ void GIProbeData::_bind_methods() { ClassDB::bind_method(_MD("set_compress","compress"),&GIProbeData::set_compress); ClassDB::bind_method(_MD("is_compressed"),&GIProbeData::is_compressed); - ADD_PROPERTY(PropertyInfo(Variant::_AABB,"bounds",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_bounds"),_SCS("get_bounds")); + ADD_PROPERTY(PropertyInfo(Variant::RECT3,"bounds",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_bounds"),_SCS("get_bounds")); ADD_PROPERTY(PropertyInfo(Variant::REAL,"cell_size",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_cell_size"),_SCS("get_cell_size")); ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM,"to_cell_xform",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_to_cell_xform"),_SCS("get_to_cell_xform")); - ADD_PROPERTY(PropertyInfo(Variant::INT_ARRAY,"dynamic_data",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_dynamic_data"),_SCS("get_dynamic_data")); + ADD_PROPERTY(PropertyInfo(Variant::POOL_INT_ARRAY,"dynamic_data",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_dynamic_data"),_SCS("get_dynamic_data")); ADD_PROPERTY(PropertyInfo(Variant::INT,"dynamic_range",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_dynamic_range"),_SCS("get_dynamic_range")); ADD_PROPERTY(PropertyInfo(Variant::REAL,"energy",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_energy"),_SCS("get_energy")); ADD_PROPERTY(PropertyInfo(Variant::BOOL,"interior",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_interior"),_SCS("is_interior")); @@ -427,7 +427,7 @@ static _FORCE_INLINE_ Vector2 get_uv(const Vector3& p_pos, const Vector3 *p_vtx, return p_uv[0]*u + p_uv[1]*v + p_uv[2]*w; } -void GIProbe::_plot_face(int p_idx, int p_level,int p_x,int p_y,int p_z, const Vector3 *p_vtx, const Vector2* p_uv, const Baker::MaterialCache& p_material, const AABB &p_aabb,Baker *p_baker) { +void GIProbe::_plot_face(int p_idx, int p_level,int p_x,int p_y,int p_z, const Vector3 *p_vtx, const Vector2* p_uv, const Baker::MaterialCache& p_material, const Rect3 &p_aabb,Baker *p_baker) { @@ -611,7 +611,7 @@ void GIProbe::_plot_face(int p_idx, int p_level,int p_x,int p_y,int p_z, const V int half = (1<<(p_baker->cell_subdiv-1)) >> (p_level+1); for(int i=0;i<8;i++) { - AABB aabb=p_aabb; + Rect3 aabb=p_aabb; aabb.size*=0.5; int nx=p_x; @@ -635,7 +635,7 @@ void GIProbe::_plot_face(int p_idx, int p_level,int p_x,int p_y,int p_z, const V continue; { - AABB test_aabb=aabb; + Rect3 test_aabb=aabb; //test_aabb.grow_by(test_aabb.get_longest_axis_size()*0.05); //grow a bit to avoid numerical error in real-time Vector3 qsize = test_aabb.size*0.5; //quarter size, for fast aabb test @@ -1001,11 +1001,11 @@ void GIProbe::_find_meshes(Node *p_at_node,Baker *p_baker){ Ref<Mesh> mesh = mi->get_mesh(); if (mesh.is_valid()) { - AABB aabb = mesh->get_aabb(); + Rect3 aabb = mesh->get_aabb(); Transform xf = get_global_transform().affine_inverse() * mi->get_global_transform(); - if (AABB(-extents,extents*2).intersects(xf.xform(aabb))) { + if (Rect3(-extents,extents*2).intersects(xf.xform(aabb))) { Baker::PlotMesh pm; pm.local_xform=xf; pm.mesh=mesh; @@ -1039,7 +1039,7 @@ void GIProbe::bake(Node *p_from_node, bool p_create_visual_debug){ baker.bake_cells.resize(1); //find out the actual real bounds, power of 2, which gets the highest subdivision - baker.po2_bounds=AABB(-extents,extents*2.0); + baker.po2_bounds=Rect3(-extents,extents*2.0); int longest_axis = baker.po2_bounds.get_longest_axis_index(); baker.axis_cell_size[longest_axis]=(1<<(baker.cell_subdiv-1)); baker.leaf_voxel_count=0; @@ -1169,7 +1169,7 @@ void GIProbe::bake(Node *p_from_node, bool p_create_visual_debug){ Ref<GIProbeData> probe_data; probe_data.instance(); - probe_data->set_bounds(AABB(-extents,extents*2.0)); + probe_data->set_bounds(Rect3(-extents,extents*2.0)); probe_data->set_cell_size(baker.po2_bounds.size[longest_axis]/baker.axis_cell_size[longest_axis]); probe_data->set_dynamic_data(data); probe_data->set_dynamic_range(dynamic_range); @@ -1190,7 +1190,7 @@ void GIProbe::bake(Node *p_from_node, bool p_create_visual_debug){ } -void GIProbe::_debug_mesh(int p_idx, int p_level, const AABB &p_aabb,Ref<MultiMesh> &p_multimesh,int &idx,Baker *p_baker) { +void GIProbe::_debug_mesh(int p_idx, int p_level, const Rect3 &p_aabb,Ref<MultiMesh> &p_multimesh,int &idx,Baker *p_baker) { if (p_level==p_baker->cell_subdiv-1) { @@ -1212,7 +1212,7 @@ void GIProbe::_debug_mesh(int p_idx, int p_level, const AABB &p_aabb,Ref<MultiMe if (p_baker->bake_cells[p_idx].childs[i]==Baker::CHILD_EMPTY) continue; - AABB aabb=p_aabb; + Rect3 aabb=p_aabb; aabb.size*=0.5; if (i&1) @@ -1332,9 +1332,9 @@ void GIProbe::_debug_bake() { bake(NULL,true); } -AABB GIProbe::get_aabb() const { +Rect3 GIProbe::get_aabb() const { - return AABB(-extents,extents*2); + return Rect3(-extents,extents*2); } PoolVector<Face3> GIProbe::get_faces(uint32_t p_usage_flags) const { diff --git a/scene/3d/gi_probe.h b/scene/3d/gi_probe.h index 55cde2960a..e416b28791 100644 --- a/scene/3d/gi_probe.h +++ b/scene/3d/gi_probe.h @@ -17,8 +17,8 @@ public: - void set_bounds(const AABB& p_bounds); - AABB get_bounds() const; + void set_bounds(const Rect3& p_bounds); + Rect3 get_bounds() const; void set_cell_size(float p_size); float get_cell_size() const; @@ -110,7 +110,7 @@ private: int leaf_voxel_count; - AABB po2_bounds; + Rect3 po2_bounds; int axis_cell_size[3]; struct PlotMesh { @@ -140,12 +140,12 @@ private: Vector<Color> _get_bake_texture(Image &p_image,const Color& p_color); Baker::MaterialCache _get_material_cache(Ref<Material> p_material,Baker *p_baker); - void _plot_face(int p_idx, int p_level, int p_x,int p_y,int p_z,const Vector3 *p_vtx, const Vector2* p_uv, const Baker::MaterialCache& p_material, const AABB &p_aabb,Baker *p_baker); + void _plot_face(int p_idx, int p_level, int p_x,int p_y,int p_z,const Vector3 *p_vtx, const Vector2* p_uv, const Baker::MaterialCache& p_material, const Rect3 &p_aabb,Baker *p_baker); void _plot_mesh(const Transform& p_xform, Ref<Mesh>& p_mesh, Baker *p_baker); void _find_meshes(Node *p_at_node,Baker *p_baker); void _fixup_plot(int p_idx, int p_level,int p_x,int p_y, int p_z,Baker *p_baker); - void _debug_mesh(int p_idx, int p_level, const AABB &p_aabb,Ref<MultiMesh> &p_multimesh,int &idx,Baker *p_baker); + void _debug_mesh(int p_idx, int p_level, const Rect3 &p_aabb,Ref<MultiMesh> &p_multimesh,int &idx,Baker *p_baker); void _create_debug_mesh(Baker *p_baker); void _debug_bake(); @@ -178,7 +178,7 @@ public: void bake(Node *p_from_node=NULL,bool p_create_visual_debug=false); - virtual AABB get_aabb() const; + virtual Rect3 get_aabb() const; virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; GIProbe(); diff --git a/scene/3d/immediate_geometry.cpp b/scene/3d/immediate_geometry.cpp index ee200cb3ea..08fc1f59e8 100644 --- a/scene/3d/immediate_geometry.cpp +++ b/scene/3d/immediate_geometry.cpp @@ -92,7 +92,7 @@ void ImmediateGeometry::clear(){ } -AABB ImmediateGeometry::get_aabb() const { +Rect3 ImmediateGeometry::get_aabb() const { return aabb; } diff --git a/scene/3d/immediate_geometry.h b/scene/3d/immediate_geometry.h index bf624e67fd..e385a34da1 100644 --- a/scene/3d/immediate_geometry.h +++ b/scene/3d/immediate_geometry.h @@ -42,7 +42,7 @@ class ImmediateGeometry : public GeometryInstance { // in VisualServer from becoming invalid if the texture is no longer used List<Ref<Texture> > cached_textures; bool empty; - AABB aabb; + Rect3 aabb; protected: static void _bind_methods(); @@ -66,7 +66,7 @@ public: - virtual AABB get_aabb() const; + virtual Rect3 get_aabb() const; virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; ImmediateGeometry(); diff --git a/scene/3d/light.cpp b/scene/3d/light.cpp index 2322df6a9e..50ee3482c3 100644 --- a/scene/3d/light.cpp +++ b/scene/3d/light.cpp @@ -114,25 +114,25 @@ Color Light::get_shadow_color() const{ } -AABB Light::get_aabb() const { +Rect3 Light::get_aabb() const { if (type==VisualServer::LIGHT_DIRECTIONAL) { - return AABB( Vector3(-1,-1,-1), Vector3(2, 2, 2 ) ); + return Rect3( Vector3(-1,-1,-1), Vector3(2, 2, 2 ) ); } else if (type==VisualServer::LIGHT_OMNI) { - return AABB( Vector3(-1,-1,-1) * param[PARAM_RANGE], Vector3(2, 2, 2 ) * param[PARAM_RANGE]); + return Rect3( Vector3(-1,-1,-1) * param[PARAM_RANGE], Vector3(2, 2, 2 ) * param[PARAM_RANGE]); } else if (type==VisualServer::LIGHT_SPOT) { float len=param[PARAM_RANGE]; float size=Math::tan(Math::deg2rad(param[PARAM_SPOT_ANGLE]))*len; - return AABB( Vector3( -size,-size,-len ), Vector3( size*2, size*2, len ) ); + return Rect3( Vector3( -size,-size,-len ), Vector3( size*2, size*2, len ) ); } - return AABB(); + return Rect3(); } PoolVector<Face3> Light::get_faces(uint32_t p_usage_flags) const { diff --git a/scene/3d/light.h b/scene/3d/light.h index 3481d0229c..d27b9fed12 100644 --- a/scene/3d/light.h +++ b/scene/3d/light.h @@ -117,7 +117,7 @@ public: Color get_shadow_color() const; - virtual AABB get_aabb() const; + virtual Rect3 get_aabb() const; virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; Light(); diff --git a/scene/3d/mesh_instance.cpp b/scene/3d/mesh_instance.cpp index 5b12f80d5c..c4712ecc7a 100644 --- a/scene/3d/mesh_instance.cpp +++ b/scene/3d/mesh_instance.cpp @@ -169,12 +169,12 @@ NodePath MeshInstance::get_skeleton_path() { return skeleton_path; } -AABB MeshInstance::get_aabb() const { +Rect3 MeshInstance::get_aabb() const { if (!mesh.is_null()) return mesh->get_aabb(); - return AABB(); + return Rect3(); } PoolVector<Face3> MeshInstance::get_faces(uint32_t p_usage_flags) const { diff --git a/scene/3d/mesh_instance.h b/scene/3d/mesh_instance.h index 1291d6b12f..4d28cc2942 100644 --- a/scene/3d/mesh_instance.h +++ b/scene/3d/mesh_instance.h @@ -80,7 +80,7 @@ public: Node* create_convex_collision_node(); void create_convex_collision(); - virtual AABB get_aabb() const; + virtual Rect3 get_aabb() const; virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; MeshInstance(); diff --git a/scene/3d/multimesh_instance.cpp b/scene/3d/multimesh_instance.cpp index a9d1de1cfa..31843fadaa 100644 --- a/scene/3d/multimesh_instance.cpp +++ b/scene/3d/multimesh_instance.cpp @@ -63,10 +63,10 @@ PoolVector<Face3> MultiMeshInstance::get_faces(uint32_t p_usage_flags) const { return PoolVector<Face3>(); } -AABB MultiMeshInstance::get_aabb() const { +Rect3 MultiMeshInstance::get_aabb() const { if (multimesh.is_null()) - return AABB(); + return Rect3(); else return multimesh->get_aabb(); } diff --git a/scene/3d/multimesh_instance.h b/scene/3d/multimesh_instance.h index ef2403a44a..535e4275a3 100644 --- a/scene/3d/multimesh_instance.h +++ b/scene/3d/multimesh_instance.h @@ -54,7 +54,7 @@ public: void set_multimesh(const Ref<MultiMesh>& p_multimesh); Ref<MultiMesh> get_multimesh() const; - virtual AABB get_aabb() const; + virtual Rect3 get_aabb() const; MultiMeshInstance(); ~MultiMeshInstance(); diff --git a/scene/3d/navigation_mesh.cpp b/scene/3d/navigation_mesh.cpp index 7ec9085e30..434b400e01 100644 --- a/scene/3d/navigation_mesh.cpp +++ b/scene/3d/navigation_mesh.cpp @@ -219,7 +219,7 @@ void NavigationMesh::_bind_methods() { ClassDB::bind_method(_MD("_set_polygons","polygons"),&NavigationMesh::_set_polygons); ClassDB::bind_method(_MD("_get_polygons"),&NavigationMesh::_get_polygons); - ADD_PROPERTY(PropertyInfo(Variant::VECTOR3_ARRAY,"vertices",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_vertices"),_SCS("get_vertices")); + ADD_PROPERTY(PropertyInfo(Variant::POOL_VECTOR3_ARRAY,"vertices",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_vertices"),_SCS("get_vertices")); ADD_PROPERTY(PropertyInfo(Variant::ARRAY,"polygons",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("_set_polygons"),_SCS("_get_polygons")); } diff --git a/scene/3d/path.cpp b/scene/3d/path.cpp index 98a81fc150..5e8ded3867 100644 --- a/scene/3d/path.cpp +++ b/scene/3d/path.cpp @@ -137,7 +137,7 @@ void PathFollow::_update_transform() { float tilt = c->interpolate_baked_tilt(o); if (tilt!=0) { - Matrix3 rot(-n,tilt); //remember.. lookat will be znegative.. znegative!! we abide by opengl clan. + Basis rot(-n,tilt); //remember.. lookat will be znegative.. znegative!! we abide by opengl clan. up=rot.xform(up); } } diff --git a/scene/3d/portal.cpp b/scene/3d/portal.cpp index e4c03a78ee..054b61a4ed 100644 --- a/scene/3d/portal.cpp +++ b/scene/3d/portal.cpp @@ -88,7 +88,7 @@ bool Portal::_get(const StringName& p_name,Variant &r_ret) const { void Portal::_get_property_list( List<PropertyInfo> *p_list) const { - p_list->push_back( PropertyInfo( Variant::REAL_ARRAY, "shape" ) ); + p_list->push_back( PropertyInfo( Variant::POOL_REAL_ARRAY, "shape" ) ); p_list->push_back( PropertyInfo( Variant::BOOL, "enabled" ) ); p_list->push_back( PropertyInfo( Variant::REAL, "disable_distance",PROPERTY_HINT_RANGE,"0,4096,0.01" ) ); p_list->push_back( PropertyInfo( Variant::COLOR, "disabled_color") ); @@ -98,7 +98,7 @@ void Portal::_get_property_list( List<PropertyInfo> *p_list) const { -AABB Portal::get_aabb() const { +Rect3 Portal::get_aabb() const { return aabb; } diff --git a/scene/3d/portal.h b/scene/3d/portal.h index 8464a628f9..077924c7e8 100644 --- a/scene/3d/portal.h +++ b/scene/3d/portal.h @@ -54,7 +54,7 @@ class Portal : public VisualInstance { Color disabled_color; float connect_range; - AABB aabb; + Rect3 aabb; protected: @@ -67,7 +67,7 @@ protected: public: - virtual AABB get_aabb() const; + virtual Rect3 get_aabb() const; virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; void set_enabled(bool p_enabled); diff --git a/scene/3d/quad.cpp b/scene/3d/quad.cpp index f1c59860af..d1cef0e851 100644 --- a/scene/3d/quad.cpp +++ b/scene/3d/quad.cpp @@ -66,7 +66,7 @@ void Quad::_update() { pointsw[3][a2]=-s2.y+offset.y; - aabb=AABB(pointsw[0],Vector3()); + aabb=Rect3(pointsw[0],Vector3()); for(int i=1;i<4;i++) aabb.expand_to(pointsw[i]); @@ -192,7 +192,7 @@ PoolVector<Face3> Quad::get_faces(uint32_t p_usage_flags) const { return PoolVector<Face3>(); } -AABB Quad::get_aabb() const { +Rect3 Quad::get_aabb() const { return aabb; } diff --git a/scene/3d/quad.h b/scene/3d/quad.h index 94b438c548..af91d7a1f5 100644 --- a/scene/3d/quad.h +++ b/scene/3d/quad.h @@ -42,7 +42,7 @@ class Quad : public GeometryInstance { Vector2 offset; Vector2 size; - AABB aabb; + Rect3 aabb; bool configured; bool pending_update; RID mesh; @@ -68,7 +68,7 @@ public: bool is_centered() const; virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; - virtual AABB get_aabb() const; + virtual Rect3 get_aabb() const; Quad(); ~Quad(); diff --git a/scene/3d/reflection_probe.cpp b/scene/3d/reflection_probe.cpp index fe56560483..d9592d9484 100644 --- a/scene/3d/reflection_probe.cpp +++ b/scene/3d/reflection_probe.cpp @@ -162,9 +162,9 @@ ReflectionProbe::UpdateMode ReflectionProbe::get_update_mode() const { } -AABB ReflectionProbe::get_aabb() const { +Rect3 ReflectionProbe::get_aabb() const { - AABB aabb; + Rect3 aabb; aabb.pos=-origin_offset; aabb.size=origin_offset+extents; return aabb; diff --git a/scene/3d/reflection_probe.h b/scene/3d/reflection_probe.h index 789e5837b0..410f590431 100644 --- a/scene/3d/reflection_probe.h +++ b/scene/3d/reflection_probe.h @@ -77,7 +77,7 @@ public: void set_update_mode(UpdateMode p_mode); UpdateMode get_update_mode() const; - virtual AABB get_aabb() const; + virtual Rect3 get_aabb() const; virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; diff --git a/scene/3d/room_instance.cpp b/scene/3d/room_instance.cpp index 137a16490d..0b19aaf151 100644 --- a/scene/3d/room_instance.cpp +++ b/scene/3d/room_instance.cpp @@ -78,12 +78,12 @@ void Room::_notification(int p_what) { -AABB Room::get_aabb() const { +Rect3 Room::get_aabb() const { if (room.is_null()) - return AABB(); + return Rect3(); - return AABB(); + return Rect3(); } PoolVector<Face3> Room::get_faces(uint32_t p_usage_flags) const { diff --git a/scene/3d/room_instance.h b/scene/3d/room_instance.h index 8cdc908ceb..145589a780 100644 --- a/scene/3d/room_instance.h +++ b/scene/3d/room_instance.h @@ -82,7 +82,7 @@ public: NOTIFICATION_AREA_CHANGED=60 }; - virtual AABB get_aabb() const; + virtual Rect3 get_aabb() const; virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; void set_room( const Ref<RoomBounds>& p_room ); diff --git a/scene/3d/spatial.cpp b/scene/3d/spatial.cpp index 50f9e45019..60580911da 100644 --- a/scene/3d/spatial.cpp +++ b/scene/3d/spatial.cpp @@ -83,7 +83,7 @@ void Spatial::_notify_dirty() { void Spatial::_update_local_transform() const { - data.local_transform.basis = Matrix3(); + data.local_transform.basis = Basis(); data.local_transform.basis.scale(data.scale); data.local_transform.basis.rotate(data.rotation); @@ -682,7 +682,7 @@ void Spatial::scale(const Vector3& p_ratio){ } void Spatial::global_rotate(const Vector3& p_normal,float p_radians){ - Matrix3 rotation(p_normal,p_radians); + Basis rotation(p_normal,p_radians); Transform t = get_global_transform(); t.basis= rotation * t.basis; set_global_transform(t); diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp index 52ae8fc5ab..a2a96d7d0e 100644 --- a/scene/3d/sprite_3d.cpp +++ b/scene/3d/sprite_3d.cpp @@ -207,7 +207,7 @@ void SpriteBase3D::_queue_update(){ } -AABB SpriteBase3D::get_aabb() const { +Rect3 SpriteBase3D::get_aabb() const { return aabb; } @@ -445,7 +445,7 @@ void Sprite3D::_draw() { } } - AABB aabb; + Rect3 aabb; for(int i=0;i<4;i++) { VS::get_singleton()->immediate_normal(immediate,normal); @@ -961,7 +961,7 @@ void AnimatedSprite3D::_draw() { } } - AABB aabb; + Rect3 aabb; for(int i=0;i<4;i++) { VS::get_singleton()->immediate_normal(immediate,normal); diff --git a/scene/3d/sprite_3d.h b/scene/3d/sprite_3d.h index f82a391038..f5d3957370 100644 --- a/scene/3d/sprite_3d.h +++ b/scene/3d/sprite_3d.h @@ -73,7 +73,7 @@ private: Vector3::Axis axis; float pixel_size; - AABB aabb; + Rect3 aabb; RID immediate; @@ -91,7 +91,7 @@ protected: void _notification(int p_what); static void _bind_methods(); virtual void _draw()=0; - _FORCE_INLINE_ void set_aabb(const AABB& p_aabb) { aabb=p_aabb; } + _FORCE_INLINE_ void set_aabb(const Rect3& p_aabb) { aabb=p_aabb; } _FORCE_INLINE_ RID& get_immediate() { return immediate; } void _queue_update(); public: @@ -134,7 +134,7 @@ public: virtual Rect2 get_item_rect() const=0; - virtual AABB get_aabb() const; + virtual Rect3 get_aabb() const; virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; SpriteBase3D(); diff --git a/scene/3d/test_cube.cpp b/scene/3d/test_cube.cpp index c2ebe63e21..c52e596032 100644 --- a/scene/3d/test_cube.cpp +++ b/scene/3d/test_cube.cpp @@ -31,9 +31,9 @@ -AABB TestCube::get_aabb() const { +Rect3 TestCube::get_aabb() const { - return AABB( Vector3(-1,-1,-1), Vector3(2, 2, 2 ) ); + return Rect3( Vector3(-1,-1,-1), Vector3(2, 2, 2 ) ); } PoolVector<Face3> TestCube::get_faces(uint32_t p_usage_flags) const { diff --git a/scene/3d/test_cube.h b/scene/3d/test_cube.h index c62999c34b..4860bacd8d 100644 --- a/scene/3d/test_cube.h +++ b/scene/3d/test_cube.h @@ -46,7 +46,7 @@ class TestCube : public GeometryInstance { public: - virtual AABB get_aabb() const; + virtual Rect3 get_aabb() const; virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; TestCube(); diff --git a/scene/3d/vehicle_body.cpp b/scene/3d/vehicle_body.cpp index 0d603902e1..1cb443225c 100644 --- a/scene/3d/vehicle_body.cpp +++ b/scene/3d/vehicle_body.cpp @@ -47,8 +47,8 @@ public: btVehicleJacobianEntry() {}; //constraint between two different rigidbodies btVehicleJacobianEntry( - const Matrix3& world2A, - const Matrix3& world2B, + const Basis& world2A, + const Basis& world2B, const Vector3& rel_pos1, const Vector3& rel_pos2, const Vector3& jointAxis, @@ -367,14 +367,14 @@ void VehicleBody::_update_wheel(int p_idx,PhysicsDirectBodyState *s) { real_t steering = wheel.steers?m_steeringValue:0.0; //print_line(itos(p_idx)+": "+rtos(steering)); - Matrix3 steeringMat(up,steering); + Basis steeringMat(up,steering); - Matrix3 rotatingMat(right,-wheel.m_rotation); + Basis rotatingMat(right,-wheel.m_rotation); // if (p_idx==1) // print_line("steeringMat " +steeringMat); - Matrix3 basis2( + Basis basis2( right[0],up[0],fwd[0], right[1],up[1],fwd[1], right[2],up[2],fwd[2] @@ -574,7 +574,7 @@ void VehicleBody::_resolve_single_bilateral(PhysicsDirectBodyState *s, const Vec Vector3 vel = vel1 - vel2; - Matrix3 b2trans; + Basis b2trans; float b2invmass=0; Vector3 b2lv; Vector3 b2av; @@ -728,7 +728,7 @@ void VehicleBody::_update_friction(PhysicsDirectBodyState *s) { //const btTransform& wheelTrans = getWheelTransformWS( i ); - Matrix3 wheelBasis0 = wheelInfo.m_worldTransform.basis;//get_global_transform().basis; + Basis wheelBasis0 = wheelInfo.m_worldTransform.basis;//get_global_transform().basis; m_axle[i] = wheelBasis0.get_axis(Vector3::AXIS_X); //m_axle[i] = wheelInfo.m_raycastInfo.m_wheelAxleWS; diff --git a/scene/3d/visibility_notifier.cpp b/scene/3d/visibility_notifier.cpp index 508e24497f..0d9d2ad725 100644 --- a/scene/3d/visibility_notifier.cpp +++ b/scene/3d/visibility_notifier.cpp @@ -60,7 +60,7 @@ void VisibilityNotifier::_exit_camera(Camera* p_camera){ } -void VisibilityNotifier::set_aabb(const AABB& p_aabb){ +void VisibilityNotifier::set_aabb(const Rect3& p_aabb){ if (aabb==p_aabb) return; @@ -74,7 +74,7 @@ void VisibilityNotifier::set_aabb(const AABB& p_aabb){ update_gizmo(); } -AABB VisibilityNotifier::get_aabb() const{ +Rect3 VisibilityNotifier::get_aabb() const{ return aabb; } @@ -113,7 +113,7 @@ void VisibilityNotifier::_bind_methods(){ ClassDB::bind_method(_MD("get_aabb"),&VisibilityNotifier::get_aabb); ClassDB::bind_method(_MD("is_on_screen"),&VisibilityNotifier::is_on_screen); - ADD_PROPERTY( PropertyInfo(Variant::_AABB,"aabb"),_SCS("set_aabb"),_SCS("get_aabb")); + ADD_PROPERTY( PropertyInfo(Variant::RECT3,"aabb"),_SCS("set_aabb"),_SCS("get_aabb")); ADD_SIGNAL( MethodInfo("enter_camera",PropertyInfo(Variant::OBJECT,"camera",PROPERTY_HINT_RESOURCE_TYPE,"Camera")) ); ADD_SIGNAL( MethodInfo("exit_camera",PropertyInfo(Variant::OBJECT,"camera",PROPERTY_HINT_RESOURCE_TYPE,"Camera")) ); @@ -124,7 +124,7 @@ void VisibilityNotifier::_bind_methods(){ VisibilityNotifier::VisibilityNotifier() { - aabb=AABB(Vector3(-1,-1,-1),Vector3(2,2,2)); + aabb=Rect3(Vector3(-1,-1,-1),Vector3(2,2,2)); } diff --git a/scene/3d/visibility_notifier.h b/scene/3d/visibility_notifier.h index ca01a9ec18..aa53e1bcd1 100644 --- a/scene/3d/visibility_notifier.h +++ b/scene/3d/visibility_notifier.h @@ -38,7 +38,7 @@ class VisibilityNotifier : public Spatial { Set<Camera*> cameras; - AABB aabb; + Rect3 aabb; protected: @@ -54,8 +54,8 @@ friend class SpatialIndexer; public: - void set_aabb(const AABB& p_aabb); - AABB get_aabb() const; + void set_aabb(const Rect3& p_aabb); + Rect3 get_aabb() const; bool is_on_screen() const; VisibilityNotifier(); diff --git a/scene/3d/visual_instance.cpp b/scene/3d/visual_instance.cpp index 812fb93dd1..466c273154 100644 --- a/scene/3d/visual_instance.cpp +++ b/scene/3d/visual_instance.cpp @@ -33,7 +33,7 @@ #include "scene/scene_string_names.h" #include "skeleton.h" -AABB VisualInstance::get_transformed_aabb() const { +Rect3 VisualInstance::get_transformed_aabb() const { return get_global_transform().xform( get_aabb() ); } diff --git a/scene/3d/visual_instance.h b/scene/3d/visual_instance.h index f59ec3a7e6..5955dae236 100644 --- a/scene/3d/visual_instance.h +++ b/scene/3d/visual_instance.h @@ -65,10 +65,10 @@ public: }; RID get_instance() const; - virtual AABB get_aabb() const=0; + virtual Rect3 get_aabb() const=0; virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const=0; - virtual AABB get_transformed_aabb() const; // helper + virtual Rect3 get_transformed_aabb() const; // helper void set_base(const RID& p_base); |