IRC Networks
Irc Logs Stats
Start date: 2007-09-27 02:48:27
Last update: 2008-10-24 20:19:38
Channels: 41
Logged Lines: 6230436
Size: 1822.22 MB
Powered by
Channel Info
Network: freenodeChannel: #csharp |
Search in www.irclog.org
Log from #csharp at freenode 2006-07-11
Pages: < Prev
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Next >
[01:05]<d0`> operator T*() { return &m_p[0]; }
[01:05]<lnvnzxu>ug
[01:05]<d0`>jhere is the hduVector http://pastebin.ca/84405
[01:06]<lnvnzxu>gotcha
[01:06]<d0`>I TRIED for days doing that operator in my own vector class, but it didn't work so I used the one form DotNet3D To do Vector Manipulations
[01:06]<jdvgdjgcgd>question, perhaps a simple one and i'm just an idiot
[01:07]<lnvnzxu>m0`: what behavior are you getting at runtime with your current signature?
[01:07]<jdvgdjgcgd>I have a type, we'll call it Device, i'm trying to assign a million of them to an array. it takes 12 seconds!!
[01:07]<d0`>it is vausing an exceptoin right here: HDDevice.hdGetDoublev(HDDefines.HD_CURRENT_POSITION, ref positionarr);
[01:07]<jdvgdjgcgd>i remove the assignment so only constructor, its instant
[01:07]<lnvnzxu>what happens without ref?
[01:08]<d0`>when I added the ref, it gave me this now: Object ref not set to an instance object
[01:08]<d0`>But I need to preserve the value of positionarr
[01:08]<jdvgdjgcgd>out
[01:08]<lnvnzxu>positionarr shouldn't change, the values in it should
[01:08]<d0`>What this does is that it gets the current position from the haptic device . hdGetDoublev(HD_CURRENT_POSITION, positionarr);
[01:08]<d0`>and places its coordinates inside positionarr
[01:08]<d0`>as an array
[01:09]<lnvnzxu>and what do you get without the ref in the interop signature?
[01:10]<d0`>OKMG
[01:10]<d0`>why does it work now ?
[01:10]<d0`>hmm
[01:10]<lnvnzxu>what was changed?
[01:10]<d0`>peterhu i took out ref, and I saw the message box....
[01:10]<lnvnzxu>verify that it is correctly populating the values
[01:10]<lnvnzxu>double[] will be marshaled as double*
[01:10]<d0`>it was causing an exception yesterday
[01:10]<lnvnzxu>ref double[] will be marshaled as double**
[01:10]<d0`>oh
[01:11]<d0`>do I need to make a new array?
[01:11]<d0`> double[] positionarr = new double[3];
[01:11]<d0`> HDDevice.hdGetDoublev(HDDefines.HD_CURRENT_POSITION, positionarr);
[01:11]<lnvnzxu>yes
[01:11]<d0`>I have to do this?
[01:11]<d0`>Is there a way I could do how it was in C++?
[01:12]<lnvnzxu>no, not really
[01:12]<cjmgrug>hey all! :)
[01:12]<d0`>it populates the values correctly withought ref
[01:12]<d0`>I wonder why it works...
[01:12]<lnvnzxu>as it should
[01:12]<d0`>I just send in a array
[01:13]<d0`>how does it preserve the values of that array after it completed the function
[01:13]<d0`>it returns nothing...
[01:13]<lnvnzxu>because you're doing this, behind the scenes: double* foo = new double[3]; /* gc */ hdGetDoublev(..., foo); /* this does foo[0] = X; foo[1] = Y; foo[2] = Z; */
[01:14]<lnvnzxu>you're passing the pointer by value
[01:14]<lnvnzxu>it modifies the contents directly
[01:14]<d0`>where am I doing double * ?
[01:14]<d0`>double[] positionarr = new double[3];
[01:14]<lnvnzxu>that's what i mean by behind the scenes
[01:14]<ymuggjt0ot>positionarr also serves a double *
[01:14]<d0`>ahmm
[01:15]<d0`>Isn't there a way I can make the return value of Vector3 positionTwell = new Vector3(); accept a double[]
[01:15]<d0`>?
[01:15]<d0`>like in c++ operator T*() { return &m_p[0]; }
[01:15]<lnvnzxu>it's a bit more than that, as in memory representations of Array have a bit more information than a C++ array, but the marshaller knows where to offset
[01:15]<lnvnzxu>m0`: no
[01:16]<d0`>i could add [MarshalAs(UnmanagedType.LPArray, SizeConst=3)]
[01:16]<d0`>that will tell the marshall its [3] i guess
[01:17]<lnvnzxu>i would keep it as you have it now, and pass positionarr to a Vector3 constructor
[01:18]<d0`>peterhu what is the best way to immitate a __kbhit() in c?
[01:18]<kzzynd>Hi any one knows how to make the reports in reportviewer accept two binding sources
[01:18]<d0`>I want the HDScheduler.hdWaitForCompletion( to go until I interrupt it
[01:19]<d0`>does this logic make sence? http://pastebin.ca/84416
[01:21]<lnvnzxu>i assume hdWaitForCompletion waits on something; how do you expect to interrupt it?
[01:22]<lnvnzxu>that logic looks fine, as far as i can tell
[01:22]<d0`>schedulerStatus is a global variable
[01:22]<d0`>when I set
[01:22]<d0`>err I am running vs2k3 + vs 2k5
[01:23]<d0`>When I press a button: private void menuRecordEnd_Click(object sender, EventArgs e)
[01:23]<d0`>it calls this _sceneGraph.StopHapticScheduler();
[01:23]<d0`>where that does: schedulerStatus = false;
[01:23]<lnvnzxu>ok, i assume that interrupts the wait
[01:24]<lnvnzxu>erm wait
[01:24]<d0`>my problem is this:
[01:24]<lnvnzxu>that's all StopHapticScheduler does?
[01:24]<d0`>yea :x
[01:24]<lnvnzxu>does it not call into the scheduler?
[01:24]<d0`>i have this in the main form: if (_sceneGraph.StartHapticScheduler())
[01:24]<d0`>that calls the function to start which I posted: http://pastebin.ca/84416
[01:25]<d0`>as you see it should do a While for ever correct? while (schedulerStatus)
[01:25]<d0`>But
[01:25]<d0`>in the main form: if (_sceneGraph.StartHapticScheduler()) { addLog("Haptic Scheduler Was Successfull");
[01:25]<d0`>I always see the Haptic Scheduler was successfull, meaning it accessed the return true somehow
[01:26]<lnvnzxu>how does the scheduler implement its asychronous behavior?
[01:26]<lnvnzxu>you're probably not privee to that
[01:28]<lnvnzxu>seems like there should be a seperate thread of operation that performs the work with the scheduler so you're not potentially preventing message pumping (assuming hdWaitForCompletion doesn't pump messages)
[01:28]<d0`>The asynchronous callback scheduling function returns a handle that can be used in the future to perform operations on the callback.
[01:28]<d0`>I really don't get it
[01:29]<d0`>it does this: if (HDScheduler.hdWaitForCompletion(hGravityWell, HDScheduler.HD_WAIT_CHECK_STATUS) != '0')
[01:29]<d0`>HDScheduler.HD_WAIT_CHECK_STATUS) Would that always be 0?
[01:29]<d0`>it is just a define of 0
[01:29]<lnvnzxu>couldn't tell you
[01:30]<d0`>thanks for your help peterhu
[01:30]<d0`>you helped me tremendously!
[01:30]<lnvnzxu>glad to hear it, time for me to hit the gym, good luck =)
[01:30]<d0`>ah don't remind me of the gym :)
[01:30]<d0`>I gave up on it years ago
[01:31]<lnvnzxu>Jivemonkey: sorry missed your earlier question
[01:31]<d0`>IT WORKS!!!!
[01:31]<d0`>yay I know my problem! I have threading issues







