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
Compare commits
No commits in common. "beb8c2460ef60676be64cba8cebcfb6d05f11ea6" and "e77901d4f057589d31b332618f812e0365b17ae1" have entirely different histories.
beb8c2460e
...
e77901d4f0
13
TheRepo/.idea/.idea.TheRepo/.idea/.gitignore
generated
vendored
13
TheRepo/.idea/.idea.TheRepo/.idea/.gitignore
generated
vendored
@ -1,13 +0,0 @@
|
||||
# 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
7
TheRepo/.idea/.idea.TheRepo/.idea/discord.xml
generated
@ -1,7 +0,0 @@
|
||||
<?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
4
TheRepo/.idea/.idea.TheRepo/.idea/encodings.xml
generated
@ -1,4 +0,0 @@
|
||||
<?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
10
TheRepo/.idea/.idea.TheRepo/.idea/indexLayout.xml
generated
@ -1,10 +0,0 @@
|
||||
<?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
7
TheRepo/.idea/.idea.TheRepo/.idea/vcs.xml
generated
@ -1,7 +0,0 @@
|
||||
<?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>
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<ResultsSessionDetails/>
|
||||
@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<ResultsSession>
|
||||
<SessionData configName="Example Configuration" configPseudoUrl="c++test.user://Example Configuration" enabledAnalysis="Static" enabledHandlers="com.parasoft.xtest.checkers.api.scope.factory;com.parasoft.xtest.checkers.api.standards.factory" header="?? ??false??false??" runId="" startTime="1758617674937" tool="c++test">
|
||||
<TestParameters cmdLn="C++test: -config c++test.user://Example Configuration "/>
|
||||
<Authors/>
|
||||
<Selection>
|
||||
<Res id="TheRepo/TheLabs/Program.cs"/>
|
||||
</Selection>
|
||||
<XmlDataFiles/>
|
||||
</SessionData>
|
||||
<Locations/>
|
||||
<CodingStandards>
|
||||
<TestedFilesDetails>
|
||||
<Total name="Suppressed / Total" supp="0" total="0"/>
|
||||
</TestedFilesDetails>
|
||||
</CodingStandards>
|
||||
</ResultsSession>
|
||||
@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
|
||||
public class MyVector
|
||||
{
|
||||
@ -11,83 +10,48 @@ public class MyVector
|
||||
public float W { get; private set; }
|
||||
public MyVector(float pX, float pY, float pZ, float pW = 1)
|
||||
{
|
||||
this.W = pW;
|
||||
this.X = pX;
|
||||
this.Y = pY;
|
||||
this.Z = pZ;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public MyVector Add(MyVector pVector)
|
||||
{
|
||||
Vector3 firstVector = new Vector3(X, Y, Z);
|
||||
Vector3 secondVector = new Vector3(pVector.X, pVector.Y,pVector.Z);
|
||||
Vector3 finishedVector = firstVector + secondVector;
|
||||
|
||||
return new MyVector(finishedVector.X, finishedVector.Y, finishedVector.Z);
|
||||
|
||||
return null;
|
||||
}
|
||||
public MyVector Subtract(MyVector pVector)
|
||||
{
|
||||
Vector3 firstVector = new Vector3(X, Y, Z);
|
||||
Vector3 secondVector = new Vector3(pVector.X, pVector.Y, pVector.Z);
|
||||
Vector3 finishedVector = firstVector - secondVector;
|
||||
|
||||
return new MyVector(finishedVector.X, finishedVector.Y, finishedVector.Z);
|
||||
return null;
|
||||
}
|
||||
public MyVector Multiply(float pScalar)
|
||||
{
|
||||
Vector3 firstVector = new Vector3(X*pScalar, Y*pScalar, Z*pScalar);
|
||||
return new MyVector(firstVector.X,firstVector.Y,firstVector.Z);
|
||||
return null;
|
||||
}
|
||||
public MyVector Divide(float pScalar)
|
||||
{
|
||||
Vector3 firstVector = new Vector3(X / pScalar, Y / pScalar, Z / pScalar);
|
||||
return new MyVector(firstVector.X, firstVector.Y, firstVector.Z);
|
||||
return null;
|
||||
}
|
||||
public float Magnitude()
|
||||
{
|
||||
float squareSum = (float)Math.Pow(X, 2) + (float)Math.Pow(Y, 2) + (float)Math.Pow(Z, 2);
|
||||
float SquareRoot = (float)Math.Sqrt(squareSum);
|
||||
return SquareRoot;
|
||||
return -1;
|
||||
}
|
||||
public MyVector Normalise()
|
||||
{
|
||||
float mag = Magnitude();
|
||||
|
||||
return new MyVector(X / mag, Y / mag, Z / mag);
|
||||
return null;
|
||||
}
|
||||
public float DotProduct(MyVector pVector)
|
||||
{
|
||||
float dotProduct = (X * pVector.X) + (Y * pVector.Y) + (Z * pVector.Z);
|
||||
return dotProduct;
|
||||
return -1;
|
||||
}
|
||||
public MyVector Interpolate(MyVector pVector, float pInterpolation)
|
||||
{
|
||||
return new MyVector(
|
||||
X + (pVector.X - X) * pInterpolation,
|
||||
Y + (pVector.Y - Y) * pInterpolation,
|
||||
Z + (pVector.Z - Z) * pInterpolation
|
||||
);
|
||||
return null;
|
||||
}
|
||||
public float AngleBetween(MyVector pVector)
|
||||
{
|
||||
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);
|
||||
return -1;
|
||||
}
|
||||
public MyVector CrossProduct(MyVector pVector)
|
||||
{
|
||||
return new MyVector(
|
||||
(Y * pVector.Z) - (Z * pVector.Y),
|
||||
(Z * pVector.X) - (X * pVector.Z),
|
||||
(X * pVector.Y) - (Y * pVector.X)
|
||||
);
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -13,8 +13,7 @@ namespace TheLabs
|
||||
Size = new Vector2i(800, 600),
|
||||
Title = "My OpenTK Example Program"
|
||||
};
|
||||
MyVector myVector = new MyVector(30, 40, 0);
|
||||
Console.WriteLine(myVector.Magnitude());
|
||||
|
||||
using (var window = new MyExampleWindow(GameWindowSettings.Default,
|
||||
nativeWindowSettings))
|
||||
{
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
|
||||
@ -14,7 +14,6 @@
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
|
||||
<PackageReference Include="OpenTK" Version="4.8.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user