Changes

Jump to: navigation, search

GAM531/DPS931 Student Resources

3,467 bytes removed, 08:34, 10 September 2016
no edit summary
<big><big> Game Engine Foundations</big></big><br />{{GAM531/DPS931 Index | 2013320167}}
=Student Resources=
The purpose of this page is to share useful information that can help students with their course work, projects and studying.
 
=Fixing Error cannot open file 'ÿþ/.exe'=
 
I ran into this error when I tried to run the engine on my desktop at home. It took me awhile to find the solution, so for those who are having the same problem as me here's what you need to do.
 
 
1. Go into your SysWOW64 folder under C:\Windows or wherever you have it at.
 
2. Replace the files c1.dll, c2.dll and cl.exe with the ones under the bin folder of your Visual Studio directory.
 
For me it's under (C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin). You might want to make backups of those files.
 
 
That's all you need to do in order to compile the engine. The problem is that those files under SysWOW64 are horrendously outdated, and since it's the folder Visual Studio looks at for those files you just need to replace them with the newer versions.
 
-[[User:Tqyu|tqyu]]
=Fixing Error S1023 for DirectX SDK=
==Useful diagrams==
* [http://www.hodgin.ca/blog/wp-content/uploads/2010/09/framework_diagram.png Class diagram of the framework Chris provides]
==Useful links around the web==
* [http://www.microsoft.com/downloads/en/details.aspx?FamilyID=529f03be-1339-48c4-bd5a-8506e5acf571&displaylang=en Download 2007 SDK]
* [http://www.hodgin.ca/?p=286 How to create a class diagram in Visual Studio]
==Useful code snippets==
foo("Hello World");
==Collision Code Snippets ==
Two teams have asked me to upgrade the framework to handle collisions. You can complete the upgrade by adding the follow snippets:
 
<pre>
// add this code to Design::initialize() - use proper values for min max points
 
jumper->setAxisAligned(Vector(-10, -10, -10), Vector(10, 10, 10));
pedestal->setAxisAligned(Vector(-10, -10, -10), Vector(10, 10, 10));
// add this code to Design::update() where dx, dy, dz are time increments in x, y, z directions
// check for collision
unsigned flags = 0u;
Vector d((float)dx, (float)dy, (float)dz);
d *= FORWARD_SPEED;
if (collision(pedestal, jumper, d, flags)) {
// respond to collision with left object
rollRight->translate(-d.x, -d.y, -d.z);
if (flags & 1u)
d.x = -d.x;
if (flags & 2u)
d.y = -d.y;
if (flags & 4u)
d.z = -d.z;
rollRight->translate(d.x, d.y, d.z);
}
// add this code to Frame.cpp and change signature of collision() in Frame.h
bool collision(const Shape* f1, const Shape* f2, Vector& d, unsigned& flags) {
// ...
else if (f1->axisAligned && f2->axisAligned) {
Vector a = f1->position();
Vector b = f2->position();
Vector ax = f1->maximum * f1->world();
Vector an = f1->minimum * f1->world();
Vector bx = f2->maximum * f2->world();
Vector bn = f2->minimum * f2->world();
collide =
ax.x >= bn.x && an.x <= bx.x &&
ax.y >= bn.y && an.y <= bx.y &&
ax.z >= bn.z && an.z <= bx.z;
if (collide) {
float lambdaxp, lambdayp, lambdazp, lambdaxn, lambdayn, lambdazn, lambda = 1.0f;
Vector n = d / d.length();
if (fabs(n.x) > 1.0e-5f) {
lambdaxp = (ax.x - bn.x) / n.x;
lambdaxn = (an.x - bx.x) / n.x;
if (lambdaxp <= 1.0f && lambdaxn >= 0.0f && lambdaxp < lambdaxn)
lambda = lambdaxp;
else if (lambdaxp <= 1.0f && lambdaxn >= 0.0f && lambdaxn < lambdaxp)
lambda = lambdaxn;
else if (lambdaxp <= 1.0f && lambdaxp >= 0.0f)
lambda = lambdaxp;
else if (lambdaxn >= 0.0f && lambdaxn <= 1.0f)
lambda = lambdaxn;
flags = 1u;
}
if (fabs(n.y) > 1.0e-5f) {
lambdayp = (ax.y - bn.y) / n.y;
lambdayn = (an.y - bx.y) / n.y;
float lambda0 = lambda;
if (lambdayp <= 1.0f && lambdayn >= 0.0f && lambdayp < lambdayn && lambda > lambdayp)
lambda = lambdayp;
else if (lambdayp <= 1.0f && lambdayn >= 0.0f && lambdayn < lambdayp && lambda > lambdayn)
lambda = lambdayn;
else if (lambdayp <= 1.0f && lambdayp >= 0.0f && lambda > lambdayp)
lambda = lambdayp;
else if (lambda >= 0.0f && lambdayn <= 1.0f && lambda > lambdayn)
lambda = lambdayn;
if (lambda != lambda0)
flags = 2u;
}
if (fabs(n.z) > 1.0e-5f) {
lambdazp = (ax.z - bn.z) / n.z;
lambdazn = (an.z - bx.z) / n.z;
float lambda0 = lambda;
if (lambdazp <= 1.0f && lambdazn >= 0.0f && lambdazp < lambdazn && lambda > lambdazp)
lambda = lambdazp;
else if (lambdazp <= 1.0f && lambdazn >= 0.0f && lambdazn < lambdazp && lambda > lambdazn)
lambda = lambdazn;
else if (lambdazp <= 1.0f && lambdazp >= 0.0f && lambda > lambdazp)
lambda = lambdazp;
else if (lambdazn >= 0.0f && lambdazn <= 1.0f && lambda > lambdazn)
lambda = lambdazn;
if (lambda != lambda0)
flags = 4u;
}
d -= lambda * n;
}
}
</pre>

Navigation menu