mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-06-14 01:14:17 +00:00
update bullet so it actually works
Moved the addSourceDirectory for physics/Bullet into the Engine/Source/CMakeLists.txt file that way it can actually appear where we expect it to in the solution explorer.
This commit is contained in:
parent
c7be48130a
commit
13fa178cf6
5986 changed files with 1811270 additions and 453803 deletions
|
|
@ -2,63 +2,76 @@
|
|||
|
||||
#include <cstdio>
|
||||
|
||||
namespace btInverseDynamics {
|
||||
|
||||
namespace btInverseDynamics
|
||||
{
|
||||
int writeGraphvizDotFile(const MultiBodyTree* tree, const MultiBodyNameMap* map,
|
||||
const char* filename) {
|
||||
if (0x0 == tree) {
|
||||
error_message("tree pointer is null\n");
|
||||
return -1;
|
||||
}
|
||||
if (0x0 == filename) {
|
||||
error_message("filename is null\n");
|
||||
return -1;
|
||||
}
|
||||
const char* filename)
|
||||
{
|
||||
if (0x0 == tree)
|
||||
{
|
||||
bt_id_error_message("tree pointer is null\n");
|
||||
return -1;
|
||||
}
|
||||
if (0x0 == filename)
|
||||
{
|
||||
bt_id_error_message("filename is null\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
FILE* fp = fopen(filename, "w");
|
||||
if (NULL == fp) {
|
||||
error_message("cannot open file %s for writing\n", filename);
|
||||
return -1;
|
||||
}
|
||||
fprintf(fp, "// to generate postscript file, run dot -Tps %s -o %s.ps\n"
|
||||
"// details see graphviz documentation at http://graphviz.org\n"
|
||||
"digraph tree {\n",
|
||||
filename, filename);
|
||||
FILE* fp = fopen(filename, "w");
|
||||
if (NULL == fp)
|
||||
{
|
||||
bt_id_error_message("cannot open file %s for writing\n", filename);
|
||||
return -1;
|
||||
}
|
||||
fprintf(fp,
|
||||
"// to generate postscript file, run dot -Tps %s -o %s.ps\n"
|
||||
"// details see graphviz documentation at http://graphviz.org\n"
|
||||
"digraph tree {\n",
|
||||
filename, filename);
|
||||
|
||||
for (int body = 0; body < tree->numBodies(); body++) {
|
||||
std::string name;
|
||||
if (0x0 != map) {
|
||||
if (-1 == map->getBodyName(body, &name)) {
|
||||
error_message("can't get name of body %d\n", body);
|
||||
return -1;
|
||||
}
|
||||
fprintf(fp, " %d [label=\"%d/%s\"];\n", body, body, name.c_str());
|
||||
}
|
||||
}
|
||||
for (int body = 0; body < tree->numBodies(); body++) {
|
||||
int parent;
|
||||
const char* joint_type;
|
||||
int qi;
|
||||
if (-1 == tree->getParentIndex(body, &parent)) {
|
||||
error_message("indexing error\n");
|
||||
return -1;
|
||||
}
|
||||
if (-1 == tree->getJointTypeStr(body, &joint_type)) {
|
||||
error_message("indexing error\n");
|
||||
return -1;
|
||||
}
|
||||
if (-1 == tree->getDoFOffset(body, &qi)) {
|
||||
error_message("indexing error\n");
|
||||
return -1;
|
||||
}
|
||||
if (-1 != parent) {
|
||||
fprintf(fp, " %d -> %d [label= \"type:%s, q=%d\"];\n", parent, body,
|
||||
joint_type, qi);
|
||||
}
|
||||
}
|
||||
for (int body = 0; body < tree->numBodies(); body++)
|
||||
{
|
||||
std::string name;
|
||||
if (0x0 != map)
|
||||
{
|
||||
if (-1 == map->getBodyName(body, &name))
|
||||
{
|
||||
bt_id_error_message("can't get name of body %d\n", body);
|
||||
return -1;
|
||||
}
|
||||
fprintf(fp, " %d [label=\"%d/%s\"];\n", body, body, name.c_str());
|
||||
}
|
||||
}
|
||||
for (int body = 0; body < tree->numBodies(); body++)
|
||||
{
|
||||
int parent;
|
||||
const char* joint_type;
|
||||
int qi;
|
||||
if (-1 == tree->getParentIndex(body, &parent))
|
||||
{
|
||||
bt_id_error_message("indexing error\n");
|
||||
return -1;
|
||||
}
|
||||
if (-1 == tree->getJointTypeStr(body, &joint_type))
|
||||
{
|
||||
bt_id_error_message("indexing error\n");
|
||||
return -1;
|
||||
}
|
||||
if (-1 == tree->getDoFOffset(body, &qi))
|
||||
{
|
||||
bt_id_error_message("indexing error\n");
|
||||
return -1;
|
||||
}
|
||||
if (-1 != parent)
|
||||
{
|
||||
fprintf(fp, " %d -> %d [label= \"type:%s, q=%d\"];\n", parent, body,
|
||||
joint_type, qi);
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(fp, "}\n");
|
||||
fclose(fp);
|
||||
return 0;
|
||||
}
|
||||
fprintf(fp, "}\n");
|
||||
fclose(fp);
|
||||
return 0;
|
||||
}
|
||||
} // namespace btInverseDynamics
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue