Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Bug #739: AddVehicleWheelEx Fails
Product:
TV3D SDK 6.5
Language:
Visual Basic.NET
Current State:
Closed
Resolution:
Not a Bug
Created On:
August 9th, 2007
Last Modified:
August 15th, 2007
Reported By:
Lyrical
We have experienced a problem where using the

Physics.AddVehicleWheelEx(Wheel1...)
Physics.AddVehicleWheelEx(Wheel2...)
Physics.AddVehicleWheelEx(Wheel3...)
Physics.AddVehicleWheelEx(Wheel4...)

if you use this function 4 time to add 4 wheels to your vehicle then set the debug option 4 times

Physics.EnableDebugInfo(wheel1, true)
Physics.EnableDebugInfo(wheel2, true)
Physics.EnableDebugInfo(wheel3, true)
Physics.EnableDebugInfo(wheel4, true)

the last

Physics.EnableDebugInfo(wheel4, showDebug)

causes the following exception

********************************************

System.AccessViolationException was unhandled
Message="Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
Source="MTV3D65"
StackTrace:
at CTVPhysics.EnableDebugInfo(CTVPhysics* , Int32 , Boolean , Int32 )
at MTV3D65.TVPhysics.EnableDebugInfo(Int32 iBodyIndex, Boolean bEnable)
at VehicleStarterKit._Core.InitObjects() in C:Documents and SettingsLyrical.INSTATETECHDesktopVehicleStarterKitVBNetVehicleStarterKit1\_Core.vb:line 353
at VehicleStarterKit._Core.Init() in C:Documents and SettingsLyrical.INSTATETECHDesktopVehicleStarterKitVBNetVehicleStarterKit1\_Core.vb:line 81
at VehicleStarterKit.frmCanvas.frmCanvas_Load(Object sender, EventArgs e) in C:Documents and SettingsLyrical.INSTATETECHDesktopVehicleStarterKitVBNetVehicleStarterKit1frmCanvas.vb:line 5
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd, Int32 nCmdShow)
at System.Windows.Forms.Control.SetVisibleCore(Boolean value)
at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
at System.Windows.Forms.Control.set_Visible(Boolean value)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(ApplicationContext context)
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String commandLine)
at VehicleStarterKit.My.MyApplication.Main(String Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
at System.AppDomain.nExecuteAssembly(Assembly assembly, String args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

********************************************

if you simply coment out the last debug setting

Physics.EnableDebugInfo(wheel1, true)
Physics.EnableDebugInfo(wheel2, true)
Physics.EnableDebugInfo(wheel3, true)
'Physics.EnableDebugInfo(wheel4, true)

Everything works just fine

NOTE:
Even if you change the order the wheel are created its always the last wheel that the debug has a broblem with.

Visual C# like for like copy works fine
Check the vehicle Starter Kit in the beta section for examples of both c# and Vb.net versions

Hope this helps.

Lyrical

Comments:

Posted by SylvainTV on August 15th, 2007 at 3:17 PM
When you create wheels ,you don't create bodies.
You just create wheels inside the chassis body.

So you have actually only to enable debug info on the chassis body, not on the wheel indices :)