如何解决Assetto corsa 共享内存
我正在使用 C# 从 Assetto Corsa 模拟/游戏中提取不同类型的数据。
我已经设置了一个简单的控制台程序,它只是打印出我想要的数据。 代码如下:
contract TestNFT is ERC721,Ownable {
struct Child {
string name;
}
struct Father {
string name;
Child[] childs;
}
mapping(uint256 => Child) private _childs;
uint256 nextChild = 0;
mapping(uint256 => Father) private _fathers;
uint256 nextFather = 0;
constructor(string memory name,string memory symbol)
ERC721(name,symbol)
{}
function mint(
string memory name
) public onlyOwner {
_safeMint(msg.sender,nextCharacter);
_childs[nextChild] = Child(name);
nextChild++;
}
function mintFather(string memory name) public onlyOwner {
_safeMint(msg.sender,nextClan);
_fathers[nextFather] = Father(name,new Child[](0));
nextFather++;
}
function insertChildToFather(uint256 fatherId,uint256 childId)
public
onlyOwner
{
Child memory child = _childs[childId];
_fathers[fatherId].childs.push(child);
}
}
上面的例子只是打印出气温并且工作正常。
我想查看的其他数据是 TyreContactNormal 值,文档中描述如下:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
using AssettoCorsaSharedMemory; //referenced to a DLL called AssettoCorsaSharedMemory.dll
using System.IO.Ports;
namespace AC_console_testing
{
class Program
{
static void Main(string[] args)
{
AssettoCorsa test = new AssettoCorsa();
test.Start(); //Starting the connection with Assetto Corsa
test.PhysicsUpdated += Test_PhysicsUpdated;
Console.Read();
}
private static void Test_PhysicsUpdated(object sender,PhysicsEventArgs e)
{
float AirTemp = e.Physics.airTemp;
Console.WriteLine(AirTemp);
}
}
}
然而,使用 tyrecontactnormal,我不知道如何获取这些数据。 在c#中intellisense给出如下描述:
float tyreContactNormal[4][3]
Vector for contact normal of each tyre[Front Left,Front Right,Rear Left,Rear Right][x,y,z]
我不知道“坐标”部分指的是什么,查找它最终会得到地理坐标,所以我希望有人能指出我正确的方向。
rgds
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。