<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[GMan's Mods & Stuff — Line3df]]></title>
		<link>https://gprogs.com/viewtopic.php?id=197</link>
		<atom:link href="https://gprogs.com/extern.php?action=feed&amp;tid=197&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Line3df.]]></description>
		<lastBuildDate>Sat, 14 Apr 2007 18:17:29 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Line3df]]></title>
			<link>https://gprogs.com/viewtopic.php?pid=774#p774</link>
			<description><![CDATA[<p>Thanks, works like a charm <img src="https://gprogs.com/img/smilies/smile.png" width="15" height="15" alt="smile" />.</p>]]></description>
			<author><![CDATA[null@example.com (Conard)]]></author>
			<pubDate>Sat, 14 Apr 2007 18:17:29 +0000</pubDate>
			<guid>https://gprogs.com/viewtopic.php?pid=774#p774</guid>
		</item>
		<item>
			<title><![CDATA[Re: Line3df]]></title>
			<link>https://gprogs.com/viewtopic.php?pid=773#p773</link>
			<description><![CDATA[<p>a couple things.&nbsp; try changing the following lines from:<br /></p><div class="codebox"><pre><code> Local ray:line3df
     ray.createFromVects(pos , tmppos)
    Local triangle:triangle3df = New triangle3df</code></pre></div><p>to<br /></p><div class="codebox"><pre><code> Local ray:line3df=Line3df.createFromVects(pos , tmppos)
 Local triangle:triangle3df = triangle3df.create()</code></pre></div><p>both ray and triangle need an actual instance in C++ to be created.&nbsp; where in just BMAX you can do a new, in the Irrlicht mod (because its a wrap) you have to use a create function or an _ function to get an actual instance.</p><p>HTH</p>]]></description>
			<author><![CDATA[null@example.com (gman)]]></author>
			<pubDate>Sat, 14 Apr 2007 17:34:23 +0000</pubDate>
			<guid>https://gprogs.com/viewtopic.php?pid=773#p773</guid>
		</item>
		<item>
			<title><![CDATA[Line3df]]></title>
			<link>https://gprogs.com/viewtopic.php?pid=772#p772</link>
			<description><![CDATA[<p>I&#039;m trying to make a function that gets me the height of an ITriangleSelector at a certain point.<br />I found this function posted somewhere on the Irrlicht forums:<br /></p><div class="codebox"><pre><code>float GetHeight(irr::IrrlichtDevice *device,scene::ITriangleSelector *Ground, const vector3df&amp; pos, float maxHeight) { 

    scene::ISceneCollisionManager* colMan = device-&gt;getSceneManager()-&gt;getSceneCollisionManager(); 

    vector3df yAxis(0,maxHeight,0); 

    line3d&lt;f32&gt; ray(pos, pos-yAxis); 

    vector3df ptoCol(0,0,0); 

    triangle3df triangle; 

    if(colMan-&gt;getCollisionPoint(ray, Ground, ptoCol, triangle)) { 

        return ptoCol.Y; 

        } 

        else 

        { 

        return -maxHeight; 

        } 
}</code></pre></div><p>This is what I came up with, trying to convert it:<br /></p><div class="codebox"><pre><code>Function getHeight:Float(dev1:IrrlichtDevice , ground:ITriangleSelector , pos:vector3df , maxHeight:Float)
    Local colMan:ISceneCollisionManager = dev1.getSceneManager().getSceneCollisionManager()
    Local yAxis:vector3df = (_VECTOR3DF(0 , maxHeight , 0))
    Local tmppos:vector3df = (_VECTOR3DF(pos.getX() , pos.getY() - yAxis.getY() , pos.getZ()))
    Local ray:line3df
     ray.createFromVects(pos , tmppos)
    Local ptoCol:vector3df = (_VECTOR3DF(0, 0, 0))
    Local triangle:triangle3df = New triangle3df
    
    If(colMan.getCollisionPoint(ray , ground , ptoCol , triangle)    )
        Return ptoCol.getY()
    Else
        Return maxHeight
    EndIf
EndFunction</code></pre></div><p>The colMan.getCollisionPoint functions, is supposed to get the collision between a line3df (ray) and an ITriangleSelector (ground) and return the collision point in a vector3df (ptoCol) and the triangle the collision is on as a triangle3df (triangle).</p><p>When I try this function out, it gives me an error, saying that &quot;If(colMan.getCollisionPoint(ray , ground , proCol , triangle))&quot; is trying to access a field or method of a NULL object.</p><p>When I look in the Debug tab of the Bmax IDE it says that &#039;Local ray:Line3df=Null&#039;.<br />When I add &quot; = New line3df&quot; behind &quot;Local ray:line3df&quot;, it will compile, but when the program starts it will give me an error saying that te program stopped unexpected.</p><p>I would appreciate it if someone could help me out with this.</p><p>Thanks in advantage.</p>]]></description>
			<author><![CDATA[null@example.com (Conard)]]></author>
			<pubDate>Sat, 14 Apr 2007 16:07:45 +0000</pubDate>
			<guid>https://gprogs.com/viewtopic.php?pid=772#p772</guid>
		</item>
	</channel>
</rss>
