<cite>@ryukajiya said:</cite>
Just throwing in an idea here without knowing how easy it would be to implement:
Have finding density and type of forrest as an interface or abstract so you could create your own logic to set those.
This would result in:
Density and type of trees based on a texture (tex coordinates mapped to world coordinates, maybe alpha = density, color = tyoe, so an RGBA image could definde types and density of up to 3 tree types).
Using the interface/abstract you could very easily come up with you own ideas to spread the trees.
Something like
[java]
private class myForrestSpread implements ForrestSpread{
private Vector3f forrestType1Spot = new Vector3f(10f, 0f, 20f);
private Vector3f forrestType2Spot = new Vector3f(80f, 0f, -30f);
private Node emptyTree = new Node("Empty");
public float getDensity(Vector3f worldPos) {
if (worldPos.distance(ForrestType1Spot) < 20f) {
return 1f - 1f / worldPos.distance(ForrestType1Spot);
}
if (worldPos.distance(ForrestType1Spot) < 35f) {
return 1f - 1f / worldPos.distance(ForrestType1Spot);
}
return 0f;
}
public Node getTreeType(Vector3f worldPos) {
if (worldPos.distance(ForrestType1Spot) < 20f) {
return (Node) assetManager.loadModel("Models/Trees/Pine.j3o");
}
if (worldPos.distance(ForrestType1Spot) < 35f) {
return (Node) assetManager.loadModel("Models/Trees/Birch.j3o");
}
return emptyTree;
}
}
[/java]
To give an example what i mean by custom defined code here
Hey. Im the one who worked on this lib. I am sorry I am not following the forum so I just noticed messages.
Biomonkey is a bit fragmented and not very well written, and could surely use a fresh start. Maybe just transfer some business logic (maybe some shader stuff etc.) that is tried and tested, instead of starting fresh. Iām not originally a Java programmer, so it should be made by a better Java programmer no doubts. It actually started out as a simple translation of an Ogre3D lib named PagedGeometry.
If anyone is ādevingā a similar lib I could give some input, about stuff I learned when working on this lib. Just general advice about pitfalls etc. that I noticed, maybe itās useful. PM me or something because Iāll check the inbox regularly in that case.
Ah, really cool to see people pulling together on this againā¦ itās really something most of us will use.
I think @androlo and @t0neg0d already worked out most of the clever stuff needed for paging, so hopefully now that our two greatest tree coders are back we can finally get a stable plugin
Sorry not back. Just found a weeks old mail saying āJoel Hemphillā wanted a reply on this thread. Cant seem to find his post but I suppose he will see its been answered.
Thanks for responding androlo, i honestly thought that you had died or something, your last reply before then was a year or two ago. by the way, i am only working on the compatiblity of a cool grass control i found, then i can upload a beta kind of version (still plenty to improve) but now i feel better, since you clearly are not angry at me for trying to make a remake of your project. (i didnāt think that you would ever be on, so i decided to try and make a remake)
PS: the thread i was talking about was the original āForesterā thread, your thread actually, but it was already answered.
@wabuilderman
Hi, I need a vegetation manager and it looked like you where building one. So do you have a git repo or somthing similar I could clone form?
@wabuilderman
why do you use:
[java]
int i = 0;
while(i < somthing){
// loop logic
i++;
}
[/java]
for loops are cleaner in my opinion and more memory effiecient because the i variable only exists within the brackets of the loop.
[java]
for(int i =0; i < somthing; i++){
// loop logic
}
[/java]
@wabuilderman
Sorry about my bitchin but you asked for comments.
Is it not more effiecient to move this piece of code:
[java]
if (solid) {
CollisionShape tempModelShape =
CollisionShapeFactory.createMeshShape((Node) tempModel);
RigidBodyControl tempModelControl = new RigidBodyControl(tempModelShape, 0);
tempModel.addControl(tempModelControl);
forPhy.getPhysicsSpace().add(tempModelControl);
}
[/java]
Outside the while loop and use the forrest node to create the physics shape, instead of casting every spatial to a node. IE:
[java]
while(){
// create the tree visuals and ataching them to the foresterNode
}
if (solid) {
CollisionShape tempModelShape =
CollisionShapeFactory.createMeshShape(foresterNodel);
RigidBodyControl tempModelControl = new RigidBodyControl(tempModelShape, 0);
tempModel.addControl(tempModelControl);
forPhy.getPhysicsSpace().add(tempModelControl);
}
[/java]
this happend in your latests post in the method: āCreateTreesā and āCreateRandomHeightTreesā
While iām bitching: It might be a good idea to start with using terrainGrid instead of terrainQuad. since terraingrid is infinite (yay).
first persons question: no, i do not have a git repository, yet.
second persons comment: yes, that would be more efficient, i just happen to have a couple of bad habbits
third persons comment: i will have to mull over that a bit, but one note: please do not use bad language here.
Sorry to all of you, i was kind of distracted in blender for a while (but now that its summer, i can do some more work on the plugin)
Note: all i have left till first release is some compatibility stuff.
Nice, Iāll have a look when the plugin repo gets updated. See if itāll work with my TiledTerrain system.
As for āterraingridā, it uses quads but should be depreciated and replaced anyways
thanksā¦ by the way, when the repo is updated, i am expecting some people to report issues/ bugsā¦ even a simple mistake in my coding, so please feel free to post any bug reports on here