AccessViolantion in

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Dr.Fred

AccessViolantion in

Post by Dr.Fred »

Everytime I call this funktion:

Code: Select all

int PortalSceneNode::cullBoxAgainsView (const core::aabbox3d<f32>& box, const scene::SViewFrustrum* View)
{
	bool clipped = false;

	for (s32 i=0; i<6; ++i)
		switch(box.classifyPlaneRelation(View->planes[i]))
		{
		case core::ISREL3D_FRONT:
			return 0; //compleatly outside
		case core::ISREL3D_CLIPPED:
			return 2; //partly inside	
		}
						
	return 1; //compleatly inside
}
I get a AccessViolantion, after the "classifyPlaneRelation" call.
Guest

Post by Guest »

Ohh, I forgot to enter the rest of the title. :oops:
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

maybe View is null?
Dr.Fred

Post by Dr.Fred »

nope
Saalen
Posts: 51
Joined: Thu Sep 04, 2003 7:49 am
Location: Germany
Contact:

Post by Saalen »

What about planes? This smells like a pointer messed up.
Guest

Post by Guest »

++i or i++?
Dr. Fred

Post by Dr. Fred »

@guest
it's the same

@Saalen
I think that is ok.
hearsedriver
Posts: 81
Joined: Fri Aug 22, 2003 12:06 pm
Location: Germany
Contact:

Post by hearsedriver »

Dr. Fred wrote:@guest
it's the same
No, it's not. But I don't want to do nitpicking here.

Cheers.
matthias gall, lead programmer at sechsta sinn - email matthias@sechsta-sinn.de
saigumi
Posts: 921
Joined: Fri Aug 22, 2003 11:31 am
Location: St. Louis, MO USA
Contact:

Post by saigumi »

Is View->planes[] a 0 or 1 based array?

If your compiler doesn't allow breakpoints and debugging, try adding output statements to figure out where and on what loop iteration exactly it is blowing up.

To me, it seems like what Saalen stated, a pointer problem of trying to access an element in the array that doesn't exist.
Crud, how do I do this again?
Post Reply