<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[GMan's Mods & Stuff — Line3df]]></title>
	<link rel="self" href="https://gprogs.com/extern.php?action=feed&amp;tid=197&amp;type=atom" />
	<updated>2007-04-14T18:17:29Z</updated>
	<generator>PunBB</generator>
	<id>https://gprogs.com/viewtopic.php?id=197</id>
		<entry>
			<title type="html"><![CDATA[Re: Line3df]]></title>
			<link rel="alternate" href="https://gprogs.com/viewtopic.php?pid=774#p774" />
			<content type="html"><![CDATA[<p>Thanks, works like a charm <img src="https://gprogs.com/img/smilies/smile.png" width="15" height="15" alt="smile" />.</p>]]></content>
			<author>
				<name><![CDATA[Conard]]></name>
				<uri>https://gprogs.com/profile.php?id=138</uri>
			</author>
			<updated>2007-04-14T18:17:29Z</updated>
			<id>https://gprogs.com/viewtopic.php?pid=774#p774</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Line3df]]></title>
			<link rel="alternate" href="https://gprogs.com/viewtopic.php?pid=773#p773" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[gman]]></name>
				<uri>https://gprogs.com/profile.php?id=2</uri>
			</author>
			<updated>2007-04-14T17:34:23Z</updated>
			<id>https://gprogs.com/viewtopic.php?pid=773#p773</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Line3df]]></title>
			<link rel="alternate" href="https://gprogs.com/viewtopic.php?pid=772#p772" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Conard]]></name>
				<uri>https://gprogs.com/profile.php?id=138</uri>
			</author>
			<updated>2007-04-14T16:07:45Z</updated>
			<id>https://gprogs.com/viewtopic.php?pid=772#p772</id>
		</entry>
</feed>
