Giter Club home page Giter Club logo

Comments (7)

ppiastucki avatar ppiastucki commented on May 21, 2024

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.

mitm001 avatar mitm001 commented on May 21, 2024

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.

mitm001 avatar mitm001 commented on May 21, 2024

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.

mitm001 avatar mitm001 commented on May 21, 2024

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.

ppiastucki avatar ppiastucki commented on May 21, 2024

I have made targetRef and targetPos public. Please let me know if there is anything else that should be changed.

from recast4j.

ppiastucki avatar ppiastucki commented on May 21, 2024

Can this issue be closed now? Are there any other fields or methods you think should be made public?

from recast4j.

mitm001 avatar mitm001 commented on May 21, 2024

Sorry, yes. there are some more but I can deal with them later. This can be closed.

from recast4j.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.