mirror of
https://github.com/UOH-CS-Level5/551455-graphics-programming-2526-the-repo-Zyb3rWolfi.git
synced 2025-11-29 00:43:08 +00:00
Completed vector resting
This commit is contained in:
parent
15eed5f7a6
commit
beb8c2460e
13
TheRepo/.idea/.idea.TheRepo/.idea/.gitignore
generated
vendored
Normal file
13
TheRepo/.idea/.idea.TheRepo/.idea/.gitignore
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
|
# Rider ignored files
|
||||||
|
/modules.xml
|
||||||
|
/contentModel.xml
|
||||||
|
/.idea.TheRepo.iml
|
||||||
|
/projectSettingsUpdater.xml
|
||||||
|
# Editor-based HTTP Client requests
|
||||||
|
/httpRequests/
|
||||||
|
# Datasource local storage ignored files
|
||||||
|
/dataSources/
|
||||||
|
/dataSources.local.xml
|
||||||
7
TheRepo/.idea/.idea.TheRepo/.idea/discord.xml
generated
Normal file
7
TheRepo/.idea/.idea.TheRepo/.idea/discord.xml
generated
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="DiscordProjectSettings">
|
||||||
|
<option name="show" value="PROJECT_FILES" />
|
||||||
|
<option name="description" value="" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
4
TheRepo/.idea/.idea.TheRepo/.idea/encodings.xml
generated
Normal file
4
TheRepo/.idea/.idea.TheRepo/.idea/encodings.xml
generated
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
|
||||||
|
</project>
|
||||||
10
TheRepo/.idea/.idea.TheRepo/.idea/indexLayout.xml
generated
Normal file
10
TheRepo/.idea/.idea.TheRepo/.idea/indexLayout.xml
generated
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="UserContentModel">
|
||||||
|
<attachedFolders>
|
||||||
|
<Path>../../551455-graphics-programming-2526-the-repo-Zyb3rWolfi</Path>
|
||||||
|
</attachedFolders>
|
||||||
|
<explicitIncludes />
|
||||||
|
<explicitExcludes />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
7
TheRepo/.idea/.idea.TheRepo/.idea/vcs.xml
generated
Normal file
7
TheRepo/.idea/.idea.TheRepo/.idea/vcs.xml
generated
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
@ -53,23 +53,41 @@ public class MyVector
|
|||||||
}
|
}
|
||||||
public MyVector Normalise()
|
public MyVector Normalise()
|
||||||
{
|
{
|
||||||
return null;
|
float mag = Magnitude();
|
||||||
|
|
||||||
|
return new MyVector(X / mag, Y / mag, Z / mag);
|
||||||
}
|
}
|
||||||
public float DotProduct(MyVector pVector)
|
public float DotProduct(MyVector pVector)
|
||||||
{
|
{
|
||||||
return -1;
|
float dotProduct = (X * pVector.X) + (Y * pVector.Y) + (Z * pVector.Z);
|
||||||
|
return dotProduct;
|
||||||
}
|
}
|
||||||
public MyVector Interpolate(MyVector pVector, float pInterpolation)
|
public MyVector Interpolate(MyVector pVector, float pInterpolation)
|
||||||
{
|
{
|
||||||
return null;
|
return new MyVector(
|
||||||
|
X + (pVector.X - X) * pInterpolation,
|
||||||
|
Y + (pVector.Y - Y) * pInterpolation,
|
||||||
|
Z + (pVector.Z - Z) * pInterpolation
|
||||||
|
);
|
||||||
}
|
}
|
||||||
public float AngleBetween(MyVector pVector)
|
public float AngleBetween(MyVector pVector)
|
||||||
{
|
{
|
||||||
return -1;
|
float dot = DotProduct(pVector);
|
||||||
|
float magA = Magnitude();
|
||||||
|
float magB = pVector.Magnitude();
|
||||||
|
|
||||||
|
float cosAngle = dot / (magA * magB);
|
||||||
|
cosAngle = Math.Clamp(cosAngle, -1.0f, 1.0f);
|
||||||
|
|
||||||
|
return (float)Math.Acos(cosAngle);
|
||||||
}
|
}
|
||||||
public MyVector CrossProduct(MyVector pVector)
|
public MyVector CrossProduct(MyVector pVector)
|
||||||
{
|
{
|
||||||
return null;
|
return new MyVector(
|
||||||
|
(Y * pVector.Z) - (Z * pVector.Y),
|
||||||
|
(Z * pVector.X) - (X * pVector.Z),
|
||||||
|
(X * pVector.Y) - (Y * pVector.X)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,6 +14,7 @@
|
|||||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
|
||||||
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
|
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
|
||||||
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
|
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
|
||||||
|
<PackageReference Include="OpenTK" Version="4.8.2" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user