Giter VIP home page Giter VIP logo

Comments (4)

mondus avatar mondus commented on June 22, 2024

Needs to have assertion errors to stop users from allowing agents to create messages outside of the bounds of the message environment. Will be integrated in version 2.

from flamegpu.

Robadob avatar Robadob commented on June 22, 2024

Snip
Neither XLST or C preprocessor macro's support (clean) floating point arithmetic, so it isn't easily feasible to check this is correct at compile time (I just hacked together a quick solution using pre-processor integer arithmetic, before noticing floating point values have been used within the examples).

Presumably such a check would therefore need to be included within the initialisation function of current FLAMEGPU, this is less desirable, but I don't see a solution for warning about this earlier. It might be possible to achieve this with XLSTs limited mathematical operations, however I'm unsure whether FLAMEGPUs packaged xlst preprocessor supports these and where I can find clear documentation on their usage.

from flamegpu.

Robadob avatar Robadob commented on June 22, 2024

Managed to get XLST math to work correctly with alot of trial and error (removing the // or space before - seemingly breaks this code), will test examples still build and commit.

<!--Compile time error if partitioning radius is not a factor of the partitioning dimensions as this causes partioning to execute incorrectly-->
<xsl:for-each select="gpu:xmodel/xmml:messages/gpu:message/gpu:partitioningSpatial">
<xsl:if test="(//gpu:xmax - //gpu:xmin) != (floor((//gpu:xmax - //gpu:xmin ) div //gpu:radius ) * //gpu:radius)">
#error "Partitioning radius must be a factor of partitioning dimensions.\nRadius: <xsl:value-of select="gpu:radius"/>, Xmin: <xsl:value-of select="gpu:xmin"/>, Xmax: <xsl:value-of select="gpu:xmax"/>"
</xsl:if><xsl:if test="(//gpu:ymax - //gpu:ymin) != (floor((//gpu:ymax - //gpu:ymin ) div //gpu:radius ) * //gpu:radius)">
#error "Partitioning radius must be a factor of partitioning dimensions.\nRadius: <xsl:value-of select="gpu:radius"/>, Ymin: <xsl:value-of select="gpu:ymin"/>, Ymax: <xsl:value-of select="gpu:ymax"/>"
</xsl:if><xsl:if test="(//gpu:zmax - //gpu:zmin) != (floor((//gpu:zmax - //gpu:zmin ) div //gpu:radius ) * //gpu:radius)">
#error "Partitioning radius must be a factor of partitioning dimensions.\nRadius: <xsl:value-of select="gpu:radius"/>, Zmin: <xsl:value-of select="gpu:zmin"/>, Zmax: <xsl:value-of select="gpu:zmax"/>"
</xsl:if>
</xsl:for-each>

from flamegpu.

Robadob avatar Robadob commented on June 22, 2024

Just updated the fix for this (and overwrote the prev fix). Discussion with Paul clarified that // notation searches from the root, meaning the above fix could work incorrectly where multiple spatial partitions exist.

I tested it again without the slashes, and the earlier error seems to have disappeared, so presumably I fixed whatever was causing that (potentially incorrect division, although that would mean it doesn't parse L2R) whilst arranging the rest of the algorithm.

82d7dc9

from flamegpu.

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.