You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Little Bits
-=-=-=-=-=- -Fixed small bugs all around -Added ability to show/hide entire sections of the spatial (3D) tree -WIP new vehicle (not ready yet) based on Bullet
This commit is contained in:
@@ -227,6 +227,7 @@ bool BodyPairSW::setup(float p_step) {
|
||||
Vector3 global_A = xform_Au.xform(c.local_A);
|
||||
Vector3 global_B = xform_Bu.xform(c.local_B);
|
||||
|
||||
|
||||
real_t depth = c.normal.dot(global_A - global_B);
|
||||
|
||||
if (depth<=0) {
|
||||
|
||||
@@ -323,6 +323,7 @@ public:
|
||||
virtual Transform get_transform() const { return body->get_transform(); }
|
||||
|
||||
virtual void add_force(const Vector3& p_force, const Vector3& p_pos) { body->add_force(p_force,p_pos); }
|
||||
virtual void apply_impulse(const Vector3& p_pos, const Vector3& p_j) { body->apply_impulse(p_pos,p_j); }
|
||||
|
||||
virtual void set_sleep_state(bool p_enable) { body->set_active(!p_enable); }
|
||||
virtual bool is_sleeping() const { return !body->is_active(); }
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -85,6 +85,7 @@ void PhysicsDirectBodyState::_bind_methods() {
|
||||
ObjectTypeDB::bind_method(_MD("get_transform"),&PhysicsDirectBodyState::get_transform);
|
||||
|
||||
ObjectTypeDB::bind_method(_MD("add_force","force","pos"),&PhysicsDirectBodyState::add_force);
|
||||
ObjectTypeDB::bind_method(_MD("apply_impulse","pos","j"),&PhysicsDirectBodyState::apply_impulse);
|
||||
|
||||
ObjectTypeDB::bind_method(_MD("set_sleep_state","enabled"),&PhysicsDirectBodyState::set_sleep_state);
|
||||
ObjectTypeDB::bind_method(_MD("is_sleeping"),&PhysicsDirectBodyState::is_sleeping);
|
||||
|
||||
@@ -58,6 +58,7 @@ public:
|
||||
virtual Transform get_transform() const=0;
|
||||
|
||||
virtual void add_force(const Vector3& p_force, const Vector3& p_pos)=0;
|
||||
virtual void apply_impulse(const Vector3& p_pos, const Vector3& p_j)=0;
|
||||
|
||||
virtual void set_sleep_state(bool p_enable)=0;
|
||||
virtual bool is_sleeping() const=0;
|
||||
|
||||
@@ -507,6 +507,7 @@ public:
|
||||
float octree_lattice_size;
|
||||
float octree_lattice_divide;
|
||||
float texture_multiplier;
|
||||
float lightmap_multiplier;
|
||||
int octree_steps;
|
||||
Vector2 octree_tex_pixel_size;
|
||||
};
|
||||
@@ -520,6 +521,7 @@ public:
|
||||
Vector<float> morph_values;
|
||||
BakedLightData *baked_light;
|
||||
Transform *baked_light_octree_xform;
|
||||
int baked_lightmap_id;
|
||||
bool mirror :8;
|
||||
bool depth_scale :8;
|
||||
bool billboard :8;
|
||||
|
||||
@@ -1005,6 +1005,11 @@ const ShaderLanguage::OperatorDef ShaderLanguage::operator_defs[]={
|
||||
|
||||
const ShaderLanguage::BuiltinsDef ShaderLanguage::vertex_builtins_defs[]={
|
||||
|
||||
{ "SRC_VERTEX", TYPE_VEC3},
|
||||
{ "SRC_NORMAL", TYPE_VEC3},
|
||||
{ "SRC_TANGENT", TYPE_VEC3},
|
||||
{ "SRC_BINORMALF", TYPE_FLOAT},
|
||||
|
||||
{ "VERTEX", TYPE_VEC3},
|
||||
{ "NORMAL", TYPE_VEC3},
|
||||
{ "TANGENT", TYPE_VEC3},
|
||||
@@ -1023,6 +1028,7 @@ const ShaderLanguage::BuiltinsDef ShaderLanguage::vertex_builtins_defs[]={
|
||||
{ "WORLD_MATRIX", TYPE_MAT4},
|
||||
{ "INV_CAMERA_MATRIX", TYPE_MAT4},
|
||||
{ "PROJECTION_MATRIX", TYPE_MAT4},
|
||||
{ "MODELVIEW_MATRIX", TYPE_MAT4},
|
||||
{ "INSTANCE_ID", TYPE_FLOAT},
|
||||
{ "TIME", TYPE_FLOAT},
|
||||
{ NULL, TYPE_VOID},
|
||||
|
||||
@@ -148,7 +148,7 @@ String VisualServerRaster::shader_get_fragment_code(RID p_shader) const{
|
||||
|
||||
String VisualServerRaster::shader_get_light_code(RID p_shader) const{
|
||||
|
||||
return rasterizer->shader_get_fragment_code(p_shader);
|
||||
return rasterizer->shader_get_light_code(p_shader);
|
||||
}
|
||||
|
||||
void VisualServerRaster::shader_get_param_list(RID p_shader, List<PropertyInfo> *p_param_list) const {
|
||||
@@ -1038,6 +1038,7 @@ RID VisualServerRaster::baked_light_create() {
|
||||
baked_light->data.octree_lattice_size=0;
|
||||
baked_light->data.octree_lattice_divide=0;
|
||||
baked_light->data.octree_steps=1;
|
||||
baked_light->data.lightmap_multiplier=1.0;
|
||||
|
||||
return baked_light_owner.make_rid( baked_light );
|
||||
|
||||
@@ -1063,6 +1064,26 @@ VisualServer::BakedLightMode VisualServerRaster::baked_light_get_mode(RID p_bake
|
||||
|
||||
}
|
||||
|
||||
void VisualServerRaster::baked_light_set_lightmap_multiplier(RID p_baked_light,float p_multiplier) {
|
||||
|
||||
VS_CHANGED;
|
||||
BakedLight *baked_light = baked_light_owner.get(p_baked_light);
|
||||
ERR_FAIL_COND(!baked_light);
|
||||
|
||||
baked_light->data.lightmap_multiplier=p_multiplier;
|
||||
|
||||
}
|
||||
|
||||
float VisualServerRaster::baked_light_get_lightmap_multiplier(RID p_baked_light) const{
|
||||
|
||||
const BakedLight *baked_light = baked_light_owner.get(p_baked_light);
|
||||
ERR_FAIL_COND_V(!baked_light,0);
|
||||
|
||||
return baked_light->data.lightmap_multiplier;
|
||||
|
||||
}
|
||||
|
||||
|
||||
void VisualServerRaster::baked_light_set_octree(RID p_baked_light,const DVector<uint8_t> p_octree){
|
||||
|
||||
VS_CHANGED;
|
||||
@@ -2568,7 +2589,7 @@ void VisualServerRaster::instance_geometry_set_baked_light_texture_index(RID p_i
|
||||
Instance *instance = instance_owner.get( p_instance );
|
||||
ERR_FAIL_COND( !instance );
|
||||
|
||||
instance->lightmap_texture_index=p_tex_id;
|
||||
instance->data.baked_lightmap_id=p_tex_id;
|
||||
|
||||
|
||||
}
|
||||
@@ -2577,7 +2598,7 @@ int VisualServerRaster::instance_geometry_get_baked_light_texture_index(RID p_in
|
||||
const Instance *instance = instance_owner.get( p_instance );
|
||||
ERR_FAIL_COND_V( !instance,0 );
|
||||
|
||||
return instance->lightmap_texture_index;
|
||||
return instance->data.baked_lightmap_id;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -157,7 +157,7 @@ class VisualServerRaster : public VisualServer {
|
||||
float draw_range_begin;
|
||||
float draw_range_end;
|
||||
float extra_margin;
|
||||
int lightmap_texture_index;
|
||||
|
||||
|
||||
|
||||
Rasterizer::InstanceData data;
|
||||
@@ -267,6 +267,7 @@ class VisualServerRaster : public VisualServer {
|
||||
data.billboard_y=false;
|
||||
data.baked_light=NULL;
|
||||
data.baked_light_octree_xform=NULL;
|
||||
data.baked_lightmap_id=-1;
|
||||
version=1;
|
||||
room_info=NULL;
|
||||
room=NULL;
|
||||
@@ -278,7 +279,7 @@ class VisualServerRaster : public VisualServer {
|
||||
draw_range_end=0;
|
||||
extra_margin=0;
|
||||
visible_in_all_rooms=false;
|
||||
lightmap_texture_index=-1;
|
||||
|
||||
baked_light=NULL;
|
||||
baked_light_info=NULL;
|
||||
BLE=NULL;
|
||||
@@ -942,6 +943,9 @@ public:
|
||||
virtual void baked_light_set_octree(RID p_baked_light,const DVector<uint8_t> p_octree);
|
||||
virtual DVector<uint8_t> baked_light_get_octree(RID p_baked_light) const;
|
||||
|
||||
virtual void baked_light_set_lightmap_multiplier(RID p_baked_light,float p_multiplier);
|
||||
virtual float baked_light_get_lightmap_multiplier(RID p_baked_light) const;
|
||||
|
||||
virtual void baked_light_add_lightmap(RID p_baked_light,const RID p_texture,int p_id);
|
||||
virtual void baked_light_clear_lightmaps(RID p_baked_light);
|
||||
|
||||
|
||||
@@ -909,6 +909,8 @@ public:
|
||||
FUNC2(baked_light_set_octree,RID,DVector<uint8_t>);
|
||||
FUNC1RC(DVector<uint8_t>,baked_light_get_octree,RID);
|
||||
|
||||
FUNC2(baked_light_set_lightmap_multiplier,RID,float);
|
||||
FUNC1RC(float,baked_light_get_lightmap_multiplier,RID);
|
||||
|
||||
FUNC3(baked_light_add_lightmap,RID,RID,int);
|
||||
FUNC1(baked_light_clear_lightmaps,RID);
|
||||
|
||||
@@ -585,6 +585,9 @@ public:
|
||||
virtual void baked_light_set_octree(RID p_baked_light,const DVector<uint8_t> p_octree)=0;
|
||||
virtual DVector<uint8_t> baked_light_get_octree(RID p_baked_light) const=0;
|
||||
|
||||
virtual void baked_light_set_lightmap_multiplier(RID p_baked_light,float p_multiplier)=0;
|
||||
virtual float baked_light_get_lightmap_multiplier(RID p_baked_light) const=0;
|
||||
|
||||
virtual void baked_light_add_lightmap(RID p_baked_light,const RID p_texture,int p_id)=0;
|
||||
virtual void baked_light_clear_lightmaps(RID p_baked_light)=0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user