Comments (7)
Definitely all members of CrowdAgentParams and ObstacleAvoidanceParams should be made public. As for other things, the general idea is to expose only the stuff that is really needed. If you find the access modifier too strict in some cases is feel free to submit a PR or an issue with all the details.
BTW, as an interim solution you can create a package named e.g. "org.recast4j.detour.crowd" in your project which will have access to all package private members from the same package in recast4j, you do not need to move any classes from recast4j to this package, just add your stuff here i.e. new classes and overrides.
from recast4j.
If you find the access modifier too strict in some cases is feel free to submit a PR or an issue with all the details.
I'm still learning what this all does and because of this I may do some things that may not be intended use and could change once I know more.
For example I currently use CrowdAgent npos[] and targetPos to determine distance from target. I do things like removing the agent from the crowd by calling removeAgent() when they reach the target or when I want to set a new path for them. I set the updateFlags inside a behavior control which gets attached to a node so every NPC that uses that control has the same behavior.
Not sure if that's the way to do things. You have CrowdAgent as package private so I am sure its for a reason and I may be exposing things unnecessarily.
Have you tried to run this entire project as a library and ran your tests in a separate project?
from recast4j.
Sorry for late post, been tied up with wiki work. This is great so far. Just a couple questions.
protected void dumpActiveAgents(int i) of AbstractCrowdTest still has problems because targetState, nvel are package private. Since this is for debug, I guess its a tossup whether or not should change.
setMoveTarget also has problems because of getAgentCount().
Lastly, a question, in CrowdAgentAnimation class the startPos and endPos variables are never set.
I wanted to make sure the intended use is for me to set these in my code when adding the agent.
from recast4j.
After reviewing how requestMoveTargetReplan and requestMoveTarget work, I now know its not possible to use CrowdAgentAnimation startPos and endPos to store the targetPos when setting the targets,
targetPos has to be public unless I am missing something. The reason I find targetPos important is I do this im my code to update the graphics objects node position,
vCopy(spatialPos, ag.npos);
vCopy(target, ag.targetPos);
Vector2f aiPosition = new Vector2f(spatialPos[0], spatialPos[2]);
Vector2f waypoint2D = new Vector2f(target[0], target[2]);
float distance = aiPosition.distance(waypoint2D);
Vector2f direction = waypoint2D.subtract(aiPosition);
if (distance > 1f) {
[snip]
}
If I set this in the userData object or store it in CrowdAgentAnimation when using requestMoveTarget, targetPos can change and I would not know it. Referencing targetPos is the only way to know for sure if its changed so I made it public.
I see nothing in searches that updates the CrowdAgentAnimation startPos and endPos so I am not sure why they are called here or if even using targetPos is appropriate for the endPos in CrowdAgentAnimation.
Maybe they get set when using some other pathfinding options or am I missing something?
from recast4j.
I have made targetRef and targetPos public. Please let me know if there is anything else that should be changed.
from recast4j.
Can this issue be closed now? Are there any other fields or methods you think should be made public?
from recast4j.
Sorry, yes. there are some more but I can deal with them later. This can be closed.
from recast4j.
Related Issues (20)
- The difference between tilecache and dynamicnavmesh HOT 1
- Why did I get a NoSuchMethodError? HOT 2
- Build Tiling NavMesh with Off Mesh Link throw error
- Tilecache add obstacle error HOT 2
- Tilecache add obstacle error HOT 4
- DynamicNavMesh TileCache.removeObstacle() is protect HOT 3
- Error when running on ubuntu HOT 2
- Can you please make the DetourCommon methods all public? HOT 2
- DetourCommon.vLerp(DetourCommon.java:56) java.lang.NullPointerException HOT 1
- TileCacheBuilder.canRemoveVertex ArrayIndexOutOfBoundsException HOT 2
- Simplifications and potential bug HOT 1
- Metric of path list got from navquery.getPath function
- java.io.ioexception invalid magic HOT 2
- Multithreading use tilecache HOT 1
- About “rcBuildPolyMesh: Too many vertices ” limit is 0xfffe
- Bug/Useless code for cylinder collision HOT 1
- Please add encoding utf-8 to javadoc as well. Or it won't compile for Chinese system.
- Typo in the method name PolygonByCircleConstraint.aply() HOT 1
- Can you help me understand why there is a discrepancy in SPAN_HEIGHT_BITS and SPAN_MAX_HEIGHT values between `recastnavigation` and `recast4j`? HOT 2
- Update AtarPathfindingProject 5.0.9. Import error HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from recast4j.