[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [30542] branches/soc-2010-nicks/source: - set defaults to steering actuator parameters
Nick Samarin
nicks1987 at bigmir.net
Tue Jul 20 16:09:05 CEST 2010
Revision: 30542
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30542
Author: nicks
Date: 2010-07-20 16:09:05 +0200 (Tue, 20 Jul 2010)
Log Message:
-----------
- set defaults to steering actuator parameters
- fixed order of triangle indexes for navigation mesh representation
Modified Paths:
--------------
branches/soc-2010-nicks/source/blender/blenkernel/intern/sca.c
branches/soc-2010-nicks/source/blender/editors/object/object_navmesh.cpp
branches/soc-2010-nicks/source/blender/makesrna/intern/rna_scene.c
branches/soc-2010-nicks/source/gameengine/Ketsji/KX_NavMeshObject.cpp
Modified: branches/soc-2010-nicks/source/blender/blenkernel/intern/sca.c
===================================================================
--- branches/soc-2010-nicks/source/blender/blenkernel/intern/sca.c 2010-07-20 14:00:41 UTC (rev 30541)
+++ branches/soc-2010-nicks/source/blender/blenkernel/intern/sca.c 2010-07-20 14:09:05 UTC (rev 30542)
@@ -468,8 +468,10 @@
case ACT_STEERING:
act->data = MEM_callocN(sizeof( bSteeringActuator), "steering act");
sta = act->data;
- sta->acceleration = 3;
- sta->turnspeed = 120;
+ sta->acceleration = 3.f;
+ sta->turnspeed = 120.f;
+ sta->dist = 1.f;
+ sta->velocity= 3.f;
default:
; /* this is very severe... I cannot make any memory for this */
/* logic brick... */
Modified: branches/soc-2010-nicks/source/blender/editors/object/object_navmesh.cpp
===================================================================
--- branches/soc-2010-nicks/source/blender/editors/object/object_navmesh.cpp 2010-07-20 14:00:41 UTC (rev 30541)
+++ branches/soc-2010-nicks/source/blender/editors/object/object_navmesh.cpp 2010-07-20 14:09:05 UTC (rev 30542)
@@ -365,8 +365,8 @@
else
face[k] = uniquevbase+tri[k]-nv; //unique vertex
}
- newFace = addfacelist(em, EM_get_vert_for_index(face[0]), EM_get_vert_for_index(face[1]),
- EM_get_vert_for_index(face[2]), NULL, NULL, NULL);
+ newFace = addfacelist(em, EM_get_vert_for_index(face[0]), EM_get_vert_for_index(face[2]),
+ EM_get_vert_for_index(face[1]), NULL, NULL, NULL);
//set navigation polygon idx to the custom layer
int* polygonIdx = (int*)CustomData_em_get(&em->fdata, newFace->data, CD_PROP_INT);
Modified: branches/soc-2010-nicks/source/blender/makesrna/intern/rna_scene.c
===================================================================
--- branches/soc-2010-nicks/source/blender/makesrna/intern/rna_scene.c 2010-07-20 14:00:41 UTC (rev 30541)
+++ branches/soc-2010-nicks/source/blender/makesrna/intern/rna_scene.c 2010-07-20 14:09:05 UTC (rev 30542)
@@ -1548,12 +1548,12 @@
prop= RNA_def_property(srna, "detailsampledist", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_range(prop, 0.0, 16.0, 1, 2);
- RNA_def_property_ui_text(prop, "Sample Distance", "Detail mesh sample spacing");
+ RNA_def_property_ui_text(prop, "Sample distance", "Detail mesh sample spacing");
RNA_def_property_update(prop, NC_SCENE, NULL);
prop= RNA_def_property(srna, "detailsamplemaxerror", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_range(prop, 0.0, 16.0, 1, 2);
- RNA_def_property_ui_text(prop, "Max Sample Error", "Detail mesh simplification max sample error");
+ RNA_def_property_ui_text(prop, "Max sample error", "Detail mesh simplification max sample error");
RNA_def_property_update(prop, NC_SCENE, NULL);
}
@@ -1608,7 +1608,7 @@
static EnumPropertyItem obstacle_simulation_items[] = {
{OBSTSIMULATION_NONE, "NONE", 0, "None", ""},
- {OBSTSIMULATION_TOI, "TOI", 0, "TOI", ""},
+ {OBSTSIMULATION_TOI, "RVO", 0, "RVO", ""},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "SceneGameData", NULL);
Modified: branches/soc-2010-nicks/source/gameengine/Ketsji/KX_NavMeshObject.cpp
===================================================================
--- branches/soc-2010-nicks/source/gameengine/Ketsji/KX_NavMeshObject.cpp 2010-07-20 14:00:41 UTC (rev 30541)
+++ branches/soc-2010-nicks/source/gameengine/Ketsji/KX_NavMeshObject.cpp 2010-07-20 14:09:05 UTC (rev 30542)
@@ -147,7 +147,7 @@
return true;
}
- //build detailed mesh adjacency
+ //build detailed mesh adjacency (with triangle reordering)
ndtris = numfaces;
dtris = new unsigned short[numfaces*3*2];
memset(dtris, 0xffff, sizeof(unsigned short)*3*2*numfaces);
@@ -155,8 +155,8 @@
{
MFace* mf = &mface[i];
dtris[i*3*2+0] = mf->v1;
- dtris[i*3*2+1] = mf->v2;
- dtris[i*3*2+2] = mf->v3;
+ dtris[i*3*2+1] = mf->v3;
+ dtris[i*3*2+2] = mf->v2;
}
buildMeshAdjacency(dtris, numfaces, numverts, 3);
@@ -477,14 +477,6 @@
flipAxes(&dvertices[i*3]);
}
-/*
- //reorder tris
- for (int i=0; i<npolys; i++)
- {
- std::swap(polys[6*i+1], polys[6*i+2]);
- }
-*/
-
buildMeshAdjacency(polys, npolys, nverts, vertsPerPoly);
float cs = 0.2f;
More information about the Bf-blender-cvs
mailing list