Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added more classes; added system to generate all.d
- Loading branch information
Showing
6 changed files
with
102 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module bullet.collision.collisionShapes.collisionShape; | ||
|
||
public import bullet.bindings.bindings; | ||
|
||
public import bullet.linearMath.btVector3; | ||
|
||
version(genBindings) void writeBindings(File f) { | ||
f.writeIncludes("#include <BulletCollision/CollisionShapes/btCollisionShape.h>"); | ||
|
||
btCollisionShape.writeBindings(f); | ||
} | ||
|
||
struct btCollisionShape { | ||
mixin classBinding!"btCollisionShape"; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module bullet.collision.collisionShapes.staticPlaneShape; | ||
|
||
public import bullet.bindings.bindings; | ||
|
||
import bullet.collision.collisionShapes.collisionShape; | ||
|
||
version(genBindings) void writeBindings(File f) { | ||
f.writeIncludes("#include <BulletCollision/CollisionShapes/btStaticPlaneShape.h>"); | ||
|
||
btStaticPlaneShape.writeBindings(f); | ||
} | ||
|
||
struct btStaticPlaneShape { | ||
mixin subclassBinding!("btStaticPlaneShape", btCollisionShape); | ||
|
||
mixin constructor!(btVector3, btScalar); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
module main; | ||
|
||
import std.algorithm; | ||
import std.file; | ||
import std.path; | ||
import std.stdio; | ||
import std.string; | ||
|
||
void writeImport(string dir) { | ||
auto f = File(dir.buildPath("all.d"), "w"); | ||
//map is needed to remove a layer of const | ||
//To do: file bug? | ||
auto pkg = dir.pathSplitter.map!((s) => s[]).join("."); | ||
f.write("module " ~ pkg ~ ".all;\n\n"); | ||
foreach(entry; dirEntries(dir, SpanMode.shallow)) { | ||
auto name = entry.baseName.stripExtension; | ||
if(name == "all" || name[0] == '.') { | ||
continue; | ||
} | ||
if(entry.isDir) { | ||
f.write("public import " ~ pkg ~ "." ~ name ~ ".all;\n"); | ||
} else { | ||
f.write("public import " ~ pkg ~ "." ~ name ~ ";\n"); | ||
} | ||
} | ||
} | ||
|
||
int main(string[] args) { | ||
writeImport("bullet"); | ||
foreach(dir; dirEntries("bullet", SpanMode.breadth)) { | ||
if(!dir.isDir) { | ||
continue; | ||
} | ||
writeImport(dir); | ||
} | ||
|
||
return 0; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters