Example #1
0
float Poly::Selector::Score(Vector3 &pos, float /*camdis*/)
{
	assert (mesh);
	const vector<Vertex>& v=mesh->verts;
	Plane plane;

	Vector3 vrt[3];
	for (int a=0;a<3;a++) 
		transform.apply(&v[poly->verts[a]].pos, &vrt[a]);
    
	plane.MakePlane (vrt[0],vrt[1],vrt[2]);
	float dis = plane.Dis (&pos);
	return fabs (dis);
}
Example #2
0
float Poly::Selector::Score(Vector3 &pos, float camdis)
{
	assert (object);
	const vector<Vertex>& v=object->verts;
	Plane plane;

	Vector3 vrt[3];
	Matrix transform;
	object->GetFullTransform(transform);
	for (int a=0;a<3;a++) 
		transform.apply(&v[poly->verts[a]].pos, &vrt[a]);
    
	plane.MakePlane (vrt[0],vrt[1],vrt[2]);
	float dis = plane.Dis (&pos);
	return fabs (dis);
}